Line | |
---|
1 | #!/bin/sh |
---|
2 | # postrm script for moodle |
---|
3 | # |
---|
4 | # see: dh_installdeb(1) |
---|
5 | |
---|
6 | set -e |
---|
7 | #set -x |
---|
8 | |
---|
9 | # summary of how this script can be called: |
---|
10 | # * <postrm> `remove' |
---|
11 | # * <postrm> `purge' |
---|
12 | # * <old-postrm> `upgrade' <new-version> |
---|
13 | # * <new-postrm> `failed-upgrade' <old-version> |
---|
14 | # * <new-postrm> `abort-install' |
---|
15 | # * <new-postrm> `abort-install' <old-version> |
---|
16 | # * <new-postrm> `abort-upgrade' <old-version> |
---|
17 | # * <disappearer's-postrm> `disappear' <overwriter> |
---|
18 | # <overwriter-version> |
---|
19 | # for details, see http://www.debian.org/doc/debian-policy/ or |
---|
20 | # the debian-policy package |
---|
21 | |
---|
22 | if [ -f /usr/share/debconf/confmodule ]; then |
---|
23 | . /usr/share/debconf/confmodule |
---|
24 | fi |
---|
25 | if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then |
---|
26 | . /usr/share/dbconfig-common/dpkg/postrm |
---|
27 | dbc_go moodle $@ |
---|
28 | fi |
---|
29 | |
---|
30 | case "$1" in |
---|
31 | purge) |
---|
32 | rm -rf /usr/share/moodle |
---|
33 | |
---|
34 | |
---|
35 | for conf in '/etc/moodle/config.php' '/etc/moodle/apache.conf' '/etc/cron.d/moodle' '/etc/moodle/apache.vhost.conf'; do |
---|
36 | for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist; do |
---|
37 | rm -f $conf$ext |
---|
38 | done |
---|
39 | |
---|
40 | # remove the configuration file itself |
---|
41 | rm -f $conf |
---|
42 | |
---|
43 | # and finally clear it out from the ucf database |
---|
44 | if which ucf >/dev/null; then |
---|
45 | ucf --purge $conf |
---|
46 | fi |
---|
47 | if which ucfr >/dev/null; then |
---|
48 | ucfr --purge foo $conf |
---|
49 | fi |
---|
50 | done |
---|
51 | |
---|
52 | rm -rf /etc/moodle |
---|
53 | rm -rf /var/lib/moodle |
---|
54 | rm -f /etc/cron.d/moodle |
---|
55 | ;; |
---|
56 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) |
---|
57 | ;; |
---|
58 | |
---|
59 | *) |
---|
60 | echo "postrm called with unknown argument \`$1'" >&2 |
---|
61 | exit 1 |
---|
62 | ;; |
---|
63 | esac |
---|
64 | |
---|
65 | #DEBHELPER# |
---|
66 | |
---|
67 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.