stage/uninstall.sh
changeset 4 c6c431cf0a89
parent 3 859eeb3579b2
equal deleted inserted replaced
3:859eeb3579b2 4:c6c431cf0a89
    30 marker='BitNami Enano CMS Module enanocms'
    30 marker='BitNami Enano CMS Module enanocms'
    31 startline=`cat $bitnami/apache2/htdocs/applications.html | grep -n "START $marker" | cut -d: -f1`
    31 startline=`cat $bitnami/apache2/htdocs/applications.html | grep -n "START $marker" | cut -d: -f1`
    32 endline=`cat $bitnami/apache2/htdocs/applications.html | grep -n "END $marker" | cut -d: -f1`
    32 endline=`cat $bitnami/apache2/htdocs/applications.html | grep -n "END $marker" | cut -d: -f1`
    33 nlines=`cat $bitnami/apache2/htdocs/applications.html | wc -l`
    33 nlines=`cat $bitnami/apache2/htdocs/applications.html | wc -l`
    34 # sanity check...
    34 # sanity check...
    35 if test $startline -gt 0 -a $endline -gt 0 -a $endline -gt $startline -a $nlines -gt $endline ; then
    35 if test "$startline" -gt 0 -a "$endline" -gt 0 -a "$endline" -gt "$startline" -a "$nlines" -gt "$endline" ; then
    36 	cat $bitnami/apache2/htdocs/applications.html | head -n$(($startline - 1)) > $bitnami/apache2/htdocs/applications.html.new
    36 	cat $bitnami/apache2/htdocs/applications.html | head -n$(($startline - 1)) > $bitnami/apache2/htdocs/applications.html.new
    37 	cat $bitnami/apache2/htdocs/applications.html | tail -n$(($nlines - $endline)) >> $bitnami/apache2/htdocs/applications.html.new
    37 	cat $bitnami/apache2/htdocs/applications.html | tail -n$(($nlines - $endline)) >> $bitnami/apache2/htdocs/applications.html.new
    38 	mv $bitnami/apache2/htdocs/applications.html $bitnami/apache2/htdocs/applications.html.bak.enanocms-uninstall || exit 1
    38 	mv $bitnami/apache2/htdocs/applications.html $bitnami/apache2/htdocs/applications.html.bak.enanocms-uninstall || exit 1
    39 	mv $bitnami/apache2/htdocs/applications.html.new $bitnami/apache2/htdocs/applications.html
    39 	mv $bitnami/apache2/htdocs/applications.html.new $bitnami/apache2/htdocs/applications.html
    40 fi
    40 fi
    41 
    41 
    42 echo "Removing app directory."
    42 echo "Removing app directory."
    43 cd $bitnami || exit 1
    43 cd $bitnami || exit 1
    44 cp apps/enanocms/uninstall.sh ./ || exit 1
       
    45 rm -rf apps/enanocms/ || exit 1
    44 rm -rf apps/enanocms/ || exit 1
    46 
    45