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
|