--- loncom/html/adm/geogebra/commands 2012/08/17 22:52:24 1.1 +++ loncom/html/adm/geogebra/commands 2015/04/04 23:12:42 1.4 @@ -1,16 +1,32 @@ currversion=0.0 -if [ -e "$1/VERSION" ] +webdir='/home/httpd/html/adm/geogebra/web' +if [ -e $webdir ] then - currversion=`cat $1/VERSION` + if [ -e "$webdir/VERSION" ] + then + currversion=`cat $webdir/VERSION` + fi fi newversion=`cat VERSION` comparison=`echo "$newversion > $currversion" | bc` if [ $comparison -gt 0 ] then - rm -rf $1/ - tar -xvf geogebra_html5.tar.gz - mv web $1 - cp VERSION $1/VERSION - chown -R www:www $1 - find $1 -type d -exec chmod u=rwx,go-rwx {} \; + if [ -e $webdir ] + then + rm -rf $webdir + if [ -e "$webdir/geogebra_html5.tar.gz" ] + then + rm "$webdir/geogebra_html5.tar.gz" + fi + fi + tar -xzf geogebraweb_4.4.tar.gz + mv web $webdir + cp VERSION $webdir/VERSION + chown -R www:www $webdir + find $webdir -type d -exec chmod u=rwx,go-rwx {} \; + if [ -e "$webdir/geogebraweb_4.4.tar.gz" ] + then + rm "$webdir/geogebraweb_4.4.tar.gz" + fi + sleep 1 fi