Annotation of loncom/html/adm/geogebra/commands, revision 1.7

1.6       raeburn     1: currversion='0.0.0'
1.2       raeburn     2: webdir='/home/httpd/html/adm/geogebra/web'
1.6       raeburn     3: cssdir='/home/httpd/html/adm/geogebra/css'
1.2       raeburn     4: if [ -e $webdir ]
1.1       www         5: then
1.2       raeburn     6:     if [ -e "$webdir/VERSION" ]
                      7:     then
                      8:         currversion=`cat $webdir/VERSION`
                      9:     fi
1.1       www        10: fi
                     11: newversion=`cat VERSION`
1.6       raeburn    12: arrnewversion=(${newversion//./ })
                     13: arrnewlength=${#arrnewversion[@]}
                     14: arrnewcomp=`echo "$arrnewlength < 3" | bc`
                     15: if [ $arrnewcomp -gt 0 ]
                     16: then
                     17:     arrnewversion[2]=0;
                     18: fi
                     19: arrcurrversion=(${currversion//./ })
                     20: arrcurrlength=${#arrcurrversion[@]}
                     21: arrcurrcomp=`echo "$arrcurrlength < 3" | bc`
                     22: if [ $arrcurrcomp -gt 0 ]
                     23: then
                     24:     arrcurrversion[2]=0;
                     25: fi
                     26: comparison=`echo "${arrnewversion[0]} > ${arrcurrversion[0]}" | bc`
                     27: if [ $comparison -eq 0 ]
                     28: then
                     29:   comparison=`echo "${arrnewversion[0]} < ${arrcurrversion[0]}" | bc`
                     30:   if [ $comparison -eq 0 ]
                     31:   then
                     32:     comparison=`echo "${arrnewversion[1]} > ${arrcurrversion[1]}" | bc`
                     33:     if [ $comparison -eq 0 ]
                     34:     then
                     35:       comparison=`echo "${arrnewversion[1]} < ${arrcurrversion[1]}" | bc`
                     36:       if [ $comparison -eq 0 ]
                     37:       then
                     38:         comparison=`echo "${arrnewversion[2]} > ${arrcurrversion[2]}" | bc`
                     39:       fi
                     40:     fi
                     41:   fi
                     42: fi
1.1       www        43: if [ $comparison -gt 0 ]
                     44: then
1.6       raeburn    45:   if [ -e $webdir ]
1.2       raeburn    46:   then
                     47:       rm -rf $webdir
1.3       raeburn    48:       if [ -e "$webdir/geogebra_html5.tar.gz" ]
                     49:       then
                     50:           rm "$webdir/geogebra_html5.tar.gz"
                     51:       fi
1.2       raeburn    52:   fi
1.6       raeburn    53:   if [ -e $cssdir ]
                     54:   then
                     55:       rm -rf $cssdir
                     56:   fi
                     57:   tar -xzf geogebraweb_5.2.843.tar.gz
1.2       raeburn    58:   mv web $webdir
1.6       raeburn    59:   mv css $cssdir
1.2       raeburn    60:   cp VERSION $webdir/VERSION
1.7     ! raeburn    61:   cp geogebraweb_license.txt $webdir/license.txt
1.2       raeburn    62:   chown -R www:www $webdir
                     63:   find $webdir -type d -exec chmod u=rwx,go-rwx {} \;
1.6       raeburn    64:   chown -R www:www $cssdir
                     65:   find $cssdir -type d -exec chmod u=rwx,go-rwx {} \;
                     66:   if [ -e "$webdir/geogebraweb_5.2.843.tar.gz" ]
1.3       raeburn    67:   then
1.6       raeburn    68:       rm "$webdir/geogebraweb_5.2.843.tar.gz"
1.3       raeburn    69:   fi
1.2       raeburn    70:   sleep 1
1.1       www        71: fi

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>