diff packaging/linux-uninstaller.inc @ 1150:a72d59f8c3ea

Create uninstaller.
author Sascha Wilde <wilde@intevation.de>
date Thu, 18 Sep 2014 13:27:57 +0200
parents
children d51ae656cfd6
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/linux-uninstaller.inc	Thu Sep 18 13:27:57 2014 +0200
@@ -0,0 +1,69 @@
+#!/bin/bash
+set -u
+
+###INCLUDE:linux-installer-common.inc
+###INCLUDE:linux-uninstaller.l10n-de
+
+###INCLUDE:linux-installer-uninstall.inc
+
+DEINSTALL=1
+
+usage()
+{
+  getxt "Usage: %s [OPTION]...\n" "$ME"
+  getxt "Uninstall TrustBridge.\n\n"
+  getxt "Options:\n"
+  getxt "  -s, --system       do a system wide deinstallation\n"
+  getxt "      --help         display this help and exit\n"
+  getxt "      --version      output version information and exit\n"
+  exit $1
+}
+
+parse_args()
+{
+  OPTS=`getopt \
+      -l help,system,version \
+      -o s -n "$ME" -- "$@"`
+  [ $? -eq 0 ] || usage 23
+
+  eval set -- "$OPTS"
+
+  while true ; do
+    case "$1" in
+      --system|-s)
+        SYSINST=1
+        shift 1
+        ;;
+      --help)
+        usage 0
+        ;;
+      --version)
+        version
+        ;;
+      --)
+        shift
+        break
+        ;;
+    esac
+  done
+}
+
+#======================================================================
+# main()
+
+parse_args "$@"
+check_priv
+init_vars
+read_oldinstcfg
+
+cat <<EOF
+------------------------------------------------------------------------
+
+   TrustBridge - Uninstaller
+   Version ${instcfg[VERSION]} - ${ARCH} (Testversion)
+
+------------------------------------------------------------------------
+EOF
+
+deinstall
+exit 0

http://wald.intevation.org/projects/trustbridge/