currversion=0 daxedir='/home/httpd/html/adm/daxe' admdir='/home/httpd/html/adm' if [ -e $daxedir ] then if [ -e "$daxedir/VERSION" ] then currversion=`cat $daxedir/VERSION` fi fi newversion=`cat VERSION` comparison=`echo "$newversion > $currversion" | bc` if [ $comparison -gt 0 ] then if [ -e $daxedir ] then rm -rf $daxedir fi tar xzf daxe.tar.gz -C $admdir cp VERSION $daxedir/VERSION chown -R www:www $daxedir find $daxedir -type d -exec chmod u=rwx,go-rwx {} \; fi