File:  [LON-CAPA] / loncom / html / adm / geogebra / commands
Revision 1.7: download - view: text, annotated - select for diffs
Sat Jun 1 15:54:58 2024 UTC (6 months, 3 weeks ago) by raeburn
Branches: MAIN
CVS tags: version_2_12_X, version_2_11_X, version_2_11_5_msu, version_2_11_5, HEAD
- Include licensing information for Geogebra HTML5 version.

currversion='0.0.0'
webdir='/home/httpd/html/adm/geogebra/web'
cssdir='/home/httpd/html/adm/geogebra/css'
if [ -e $webdir ]
then
    if [ -e "$webdir/VERSION" ]
    then
        currversion=`cat $webdir/VERSION`
    fi
fi
newversion=`cat VERSION`
arrnewversion=(${newversion//./ })
arrnewlength=${#arrnewversion[@]}
arrnewcomp=`echo "$arrnewlength < 3" | bc`
if [ $arrnewcomp -gt 0 ]
then
    arrnewversion[2]=0;
fi
arrcurrversion=(${currversion//./ })
arrcurrlength=${#arrcurrversion[@]}
arrcurrcomp=`echo "$arrcurrlength < 3" | bc`
if [ $arrcurrcomp -gt 0 ]
then
    arrcurrversion[2]=0;
fi
comparison=`echo "${arrnewversion[0]} > ${arrcurrversion[0]}" | bc`
if [ $comparison -eq 0 ]
then
  comparison=`echo "${arrnewversion[0]} < ${arrcurrversion[0]}" | bc`
  if [ $comparison -eq 0 ]
  then
    comparison=`echo "${arrnewversion[1]} > ${arrcurrversion[1]}" | bc`
    if [ $comparison -eq 0 ]
    then
      comparison=`echo "${arrnewversion[1]} < ${arrcurrversion[1]}" | bc`
      if [ $comparison -eq 0 ]
      then
        comparison=`echo "${arrnewversion[2]} > ${arrcurrversion[2]}" | bc`
      fi
    fi
  fi
fi
if [ $comparison -gt 0 ]
then
  if [ -e $webdir ]
  then
      rm -rf $webdir
      if [ -e "$webdir/geogebra_html5.tar.gz" ]
      then
          rm "$webdir/geogebra_html5.tar.gz"
      fi
  fi
  if [ -e $cssdir ]
  then
      rm -rf $cssdir
  fi
  tar -xzf geogebraweb_5.2.843.tar.gz
  mv web $webdir
  mv css $cssdir
  cp VERSION $webdir/VERSION
  cp geogebraweb_license.txt $webdir/license.txt
  chown -R www:www $webdir
  find $webdir -type d -exec chmod u=rwx,go-rwx {} \;
  chown -R www:www $cssdir
  find $cssdir -type d -exec chmod u=rwx,go-rwx {} \;
  if [ -e "$webdir/geogebraweb_5.2.843.tar.gz" ]
  then
      rm "$webdir/geogebraweb_5.2.843.tar.gz"
  fi
  sleep 1
fi

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>