File: dancer-ircd.postinst

package info (click to toggle)
dancer-ircd 1.0.36-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 3,204 kB
  • ctags: 2,703
  • sloc: ansic: 36,121; sh: 3,534; perl: 612; makefile: 307
file content (47 lines) | stat: -rw-r--r-- 1,061 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
41
42
43
44
45
46
47
#! /bin/sh
# postinst script for dancer-ircd

set -e

USER=dancer

case "$1" in
    configure)
        if ! grep -q "^dancer:" /etc/passwd; then
	    echo Creating a user \'$USER\'...
	    adduser --quiet --system --home /var/run/dancer-ircd \
		--disabled-password --no-create-home --group \
		$USER
	fi

	touch /var/lib/dancer-ircd/dline.conf
	touch /var/lib/dancer-ircd/kline.conf

        # Changing the user is not supported; this is an upstream
        # limitation. Someday it will be fixed

	chown $USER:$USER /var/log/dancer-ircd
	chown $USER:$USER /var/run/dancer-ircd
	chown $USER:$USER /var/lib/dancer-ircd
	chown $USER:$USER /var/lib/dancer-ircd/dline.conf
	chown $USER:$USER /var/lib/dancer-ircd/kline.conf
	chmod 0640 /var/lib/dancer-ircd/dline.conf /var/lib/dancer-ircd/kline.conf
	chgrp $USER /etc/dancer-ircd/ircd.conf
	chgrp $USER /etc/dancer-ircd/olines
    ;;

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

    ;;

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

#DEBHELPER#

exit 0