File: libdspam7.postinst

package info (click to toggle)
dspam 3.6.8-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,372 kB
  • ctags: 1,457
  • sloc: ansic: 24,738; sh: 9,860; perl: 2,378; makefile: 546; sql: 327
file content (40 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (3)
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
37
38
39
40
#!/bin/sh

set -e

test $DEBIAN_SCRIPT_DEBUG && set -v -x

create_user() {
    # idea stolen from postfix.postinst: make sure our user exists,
    # simplest portable way to check is to chown something.
    touch /var/spool/dspam/temp
    if ! chown dspam /var/spool/dspam/temp 2>/dev/null; then
        addgroup --quiet --system dspam
        adduser --quiet --system --ingroup dspam --home /var/spool/dspam \
            --no-create-home --disabled-password \
            --gecos 'DSPAM' dspam
    fi
    rm -f /var/spool/dspam/temp 2>/dev/null
    return 0
}

case "$1" in
    configure)
        create_user
    ;;

    reconfigure)
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0