currversion=0.0 mathjaxdir='/home/httpd/html/adm/MathJax' if [ -e $mathjaxdir ] then if [ -e "$mathjaxdir/VERSION" ] then currversion=`cat $mathjaxdir/VERSION` fi fi newversion=`cat VERSION` comparison=`echo "$newversion > $currversion" | bc` if [ $comparison -gt 0 ] then if [ -e $mathjaxdir ] then rm -rf $mathjaxdir fi unzip -q -o -d $mathjaxdir mathjax-MathJax-v2.7.4.zip mv $mathjaxdir/MathJax-2.7.4/* $mathjaxdir/. rm -r $mathjaxdir/MathJax-2.7.4 cp VERSION $mathjaxdir/VERSION chown -R www:www $mathjaxdir find $mathjaxdir -type d -exec chmod u=rwx,go-rwx {} \; fi