debian/postrm
author Markus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Dec 2008 15:27:30 +0100
changeset 0 586472add385
child 26 767f79e69de1
permissions -rw-r--r--
Initial Layout committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
#!/bin/sh
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
# postrm script for mcbot
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     3
#
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     4
# see: dh_installdeb(1)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
set -e
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     8
# summary of how this script can be called:
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
#        * <postrm> `remove'
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
#        * <postrm> `purge'
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    11
#        * <old-postrm> `upgrade' <new-version>
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
#        * <new-postrm> `failed-upgrade' <old-version>
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    13
#        * <new-postrm> `abort-install'
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    14
#        * <new-postrm> `abort-install' <old-version>
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    15
#        * <new-postrm> `abort-upgrade' <old-version>
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    16
#        * <disappearer's-postrm> `disappear' <overwriter>
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    17
#          <overwriter-version>
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    18
# for details, see http://www.debian.org/doc/debian-policy/ or
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    19
# the debian-policy package
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    20
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    21
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    22
case "$1" in
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    23
    purge)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    24
	rm -rf /var/lib/nobody/data;
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    25
	rm -f /var/lib/nobody/.mcbotrc;
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    26
	rm -f /var/lib/nobody/mcbot-*.log;
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    27
	usermod -d /nonexistent -s /bin/bash nobody
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    28
    ;;
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    29
    
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    30
    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    31
	usermod -d /nonexistent -s /bin/bash nobody
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    32
	;;
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    33
	
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    34
    *)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    35
        echo "postrm called with unknown argument \`$1'" >&2
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    36
        exit 1
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    37
    ;;
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    38
esac
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    39
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    40
# dh_installdeb will replace this with shell code automatically
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    41
# generated by other debhelper scripts.
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    42
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    43
#DEBHELPER#
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    44
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    45
exit 0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    46
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    47