--- loncom/html/adm/ckeditor/commands 2013/01/10 05:36:22 1.4 +++ loncom/html/adm/ckeditor/commands 2015/03/31 13:45:39 1.7 @@ -1,5 +1,30 @@ path=`pwd` htmldir='/home/httpd/html' +currversion=4.47 +ckeditordir="$htmldir/ckeditor" +if [ -e $ckeditordir ] +then + if [ -e "$ckeditordir/VERSION" ] + then + currversion=`cat $ckeditordir/VERSION` + fi +fi +newversion=`cat VERSION` +comparison=`echo "$newversion > $currversion" | bc` +if [ $comparison -gt 0 ] +then + if [ -e $ckeditordir ] + then + rm -rf $ckeditordir + fi + cd $htmldir + echo $path/ckeditor_4.4.7.tar.gz + tar -zxf $path/ckeditor_4.4.7.tar.gz + cp -r $path/plugins/lcm ckeditor/plugins/ + cp $path/VERSION ckeditor/VERSION + cp $path/loncapaconfig.js ckeditor/loncapaconfig.js + chown -R www:www ckeditor +fi if [ -e "$htmldir/fckeditor" ] then rm -rf $htmldir/fckeditor @@ -8,7 +33,7 @@ if [ -e "$htmldir/htmlarea" ] then rm -rf $htmldir/htmlarea fi -cd $htmldir -echo $path/ckeditor_3.6.2.tar.gz -tar -zxf $path/ckeditor_3.6.2.tar.gz -cp $path/loncapaconfig.js ckeditor/loncapaconfig.js +if [ -e "$htmldir/adm/ckeditor" ] +then + rm -rf $htmldir/adm/ckeditor +fi