annotate 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
rev   line source
1150
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
1 #!/bin/bash
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
2 set -u
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
3
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
4 ###INCLUDE:linux-installer-common.inc
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
5 ###INCLUDE:linux-uninstaller.l10n-de
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
6
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
7 ###INCLUDE:linux-installer-uninstall.inc
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
8
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
9 DEINSTALL=1
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
10
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
11 usage()
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
12 {
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
13 getxt "Usage: %s [OPTION]...\n" "$ME"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
14 getxt "Uninstall TrustBridge.\n\n"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
15 getxt "Options:\n"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
16 getxt " -s, --system do a system wide deinstallation\n"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
17 getxt " --help display this help and exit\n"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
18 getxt " --version output version information and exit\n"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
19 exit $1
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
20 }
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
21
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
22 parse_args()
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
23 {
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
24 OPTS=`getopt \
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
25 -l help,system,version \
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
26 -o s -n "$ME" -- "$@"`
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
27 [ $? -eq 0 ] || usage 23
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
28
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
29 eval set -- "$OPTS"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
30
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
31 while true ; do
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
32 case "$1" in
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
33 --system|-s)
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
34 SYSINST=1
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
35 shift 1
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
36 ;;
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
37 --help)
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
38 usage 0
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
39 ;;
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
40 --version)
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
41 version
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
42 ;;
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
43 --)
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
44 shift
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
45 break
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
46 ;;
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
47 esac
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
48 done
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
49 }
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
50
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
51 #======================================================================
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
52 # main()
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
53
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
54 parse_args "$@"
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
55 check_priv
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
56 init_vars
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
57 read_oldinstcfg
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
58
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
59 cat <<EOF
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
60 ------------------------------------------------------------------------
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
61
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
62 TrustBridge - Uninstaller
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
63 Version ${instcfg[VERSION]} - ${ARCH} (Testversion)
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
64
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
65 ------------------------------------------------------------------------
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
66 EOF
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
67
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
68 deinstall
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
69 exit 0

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