[mapguide-commits] r8426 - trunk/Tools/Vagrant/scripts

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Oct 19 20:21:09 PDT 2014


Author: jng
Date: 2014-10-19 20:21:09 -0700 (Sun, 19 Oct 2014)
New Revision: 8426

Added:
   trunk/Tools/Vagrant/scripts/mguninstallcentos.sh
Modified:
   trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh
Log:
#2496: 
   - Add CentOS uninstall script
   - Add service un-registration in the Ubuntu uninstall script

Added: trunk/Tools/Vagrant/scripts/mguninstallcentos.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mguninstallcentos.sh	                        (rev 0)
+++ trunk/Tools/Vagrant/scripts/mguninstallcentos.sh	2014-10-20 03:21:09 UTC (rev 8426)
@@ -0,0 +1,54 @@
+#!/bin/bash
+FDOVER_MAJOR_MINOR=3.9
+FDOVER_POINT=0
+FDOVER_MAJOR_MINOR_REV=${FDOVER_MAJOR_MINOR}.${FDOVER_POINT}
+MGVER_MAJOR_MINOR=3.0
+MGVER_POINT=0
+MGVER_MAJOR_MINOR_REV=${MGVER_MAJOR_MINOR}.${MGVER_POINT}
+
+FDOINST=/usr/local/fdo-${FDOVER_MAJOR_MINOR_REV}
+MGINST=/usr/local/mapguideopensource-${MGVER_MAJOR_MINOR_REV}
+
+# Must have root
+if [[ $EUID -ne 0 ]]; then
+    echo "You must run this script with superuser privileges"
+    exit 1
+fi
+
+do_uninstall()
+{
+    if [ -f /etc/init.d/mapguide ]; then
+        echo "[uninstall]: Remove mapguide service"
+        /etc/init.d/mapguide stop
+        chkconfig --del mapguide
+        rm -f /etc/init.d/mapguide
+    fi
+
+    if [ -f /etc/init.d/apache-mapguide ]; then
+        echo "[uninstall]: Remove apache-mapguide service"
+        /etc/init.d/apache-mapguide stop
+        chkconfig --del apache-mapguide
+        rm -f /etc/init.d/apache-mapguide
+    fi
+
+    if [ -d $MGINST ]; then
+        echo "[uninstall]: Uninstalling MapGuide"
+        rm -rf $MGINST
+    fi
+
+    if [ -d $FDOINST ]; then
+        echo "[uninstall]: Uninstalling FDO"
+        rm -rf $FDOINST
+    fi
+    
+    echo "Uninstall completed"
+}
+
+while true; do
+    read -p 'This script will remove everything under the MapGuide and FDO installation directories and un-register any installed services. Do you wish to uninstall MapGuide? [y/n]' yn
+    case $yn in
+        [Yy]* ) do_uninstall; break;;
+        [Nn]* ) exit;;
+        * ) echo "Please answer yes or no.";;
+    esac
+done

Modified: trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh
===================================================================
--- trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh	2014-10-19 13:49:23 UTC (rev 8425)
+++ trunk/Tools/Vagrant/scripts/mguninstallubuntu.sh	2014-10-20 03:21:09 UTC (rev 8426)
@@ -2,20 +2,48 @@
 
 # Must have root
 if [[ $EUID -ne 0 ]]; then
-	echo "You must run this script with superuser privileges"
-	exit 1
+    echo "You must run this script with superuser privileges"
+    exit 1
 fi
 
-# Remove Ubuntu packages for MapGuide
-for file in server webextensions httpd coordsys coordsys-lite common platformbase
-do
-  dpkg --remove mapguideopensource-${file}
-done
+do_uninstall()
+{
+    # Stop and un-register mapguide service
+    echo "[uninstall]: Removing mapguide service"
+    if [ -f /etc/init.d/mapguide ]; then
+        /etc/init.d/mapguide stop
+        update-rc.d -f mapguide remove
+        rm -f /etc/init.d/mapguide
+    fi
+    echo "[uninstall]: Removing apache-mapguide service"
+    if [ -f /etc/init.d/apache-mapguide ]; then
+        /etc/init.d/apache-mapguide stop
+        update-rc.d -f apache-mapguide remove
+        rm -f /etc/init.d/apache-mapguide
+    fi
 
-# Remove Ubuntu packages for FDO
-for file in gdal kingoracle ogr rdbms sdf shp sqlite wfs wms arcsde core
-do
-  dpkg --remove fdo-${file}
-done
+    # Remove Ubuntu packages for MapGuide
+    echo "[uninstall]: MapGuide packages"
+    for file in server webextensions httpd coordsys coordsys-lite common platformbase
+    do
+        dpkg --remove mapguideopensource-${file}
+    done
 
+    # Remove Ubuntu packages for FDO
+    echo "[uninstall]: FDO packages"
+    for file in gdal kingoracle ogr rdbms sdf shp sqlite wfs wms arcsde core
+    do
+        dpkg --remove fdo-${file}
+    done
+    
+    echo "Uninstall completed"
+}
 
+while true; do
+    read -p 'This script will uninstall the MapGuide and FDO packages and un-register any installed services. Do you wish to uninstall MapGuide? [y/n]' yn
+    case $yn in
+        [Yy]* ) do_uninstall; break;;
+        [Nn]* ) exit;;
+        * ) echo "Please answer yes or no.";;
+    esac
+done
\ No newline at end of file



More information about the mapguide-commits mailing list