File: postrm

package info (click to toggle)
dictd 1.5.5-10
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,684 kB
  • ctags: 2,466
  • sloc: ansic: 20,532; sh: 1,692; makefile: 793; perl: 391; yacc: 189; lex: 166
file content (36 lines) | stat: -rw-r--r-- 749 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/sh

set -e

PID=`pidof -x dictd` ||true

case "$1" in
    failed-upgrade)
        if [ "$PID" ]; then  kill $PID 2>/dev/null; fi
        exit 0
    ;;

    remove)
        if [ "$PID" ]; then  kill $PID 2>/dev/null; fi


    ;;
    purge)
        if [ "$PID" ]; then  kill $PID 2>/dev/null; fi
        update-rc.d dictd remove >/dev/null
        rm -fr /var/lib/dictd/
# remove user and group dictd
        deluser dictd &>/dev/null
        delgroup dictd &>/dev/null
# remove dictd home directory if it is empty
        rmdir /home/dictd &>/dev/null
        exit 0
    ;;
    upgrade|abort-install|abort-upgrade|disappear)
        exit 0
    ;;
    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac