--- loncom/html/adm/MathJax/commands 2012/05/24 01:35:55 1.2 +++ loncom/html/adm/MathJax/commands 2013/01/10 05:36:15 1.3 @@ -1,17 +1,24 @@ currversion=0.0 -if [ -e "$1/VERSION" ] +mathjaxdir='/home/httpd/html/adm/MathJax' +if [ -e $mathjaxdir ] then - currversion=`cat $1/VERSION` + if [ -e "$mathjaxdir/VERSION" ] + then + currversion=`cat $mathjaxdir/VERSION` + fi fi newversion=`cat VERSION` comparison=`echo "$newversion > $currversion" | bc` if [ $comparison -gt 0 ] then - rm -rf $1/ - unzip -q -o -d $1 mathjax-MathJax-v2.0-20-g07669ac.zip - mv $1/mathjax-MathJax-07669ac/* $1/. - rm -r $1/mathjax-MathJax-07669ac - cp VERSION $1/VERSION - chown -R www:www $1 - find $1 -type d -exec chmod u=rwx,go-rwx {} \; + if [ -e $mathjaxdir ] + then + rm -rf $mathjaxdir + fi + unzip -q -o -d $mathjaxdir mathjax-MathJax-v2.0-20-g07669ac.zip + mv $mathjaxdir/mathjax-MathJax-07669ac/* $mathjaxdir/. + rm -r $mathjaxdir/mathjax-MathJax-07669ac + cp VERSION $mathjaxdir/VERSION + chown -R www:www $mathjaxdir + find $mathjaxdir -type d -exec chmod u=rwx,go-rwx {} \; fi