postinst is in dansguardian 2.10.1.1-5.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 | #! /bin/sh -e
if ! id -u dansguardian > /dev/null 2>&1 ; then
adduser --system --group \
--disabled-login \
--gecos "DansGuardian User" \
--home /var/log/dansguardian \
--shell /bin/sh \
dansguardian
fi
dguser=`grep daemonuser /etc/dansguardian/dansguardian.conf|grep -v '^\ *#' \
|awk -F = '{print $2}'|tr -d \ \'`
dggroup=`grep daemongroup /etc/dansguardian/dansguardian.conf|grep -v '^\ *#' \
|awk -F = '{print $2}'|tr -d \ \'`
logdir=`grep loglocation /etc/dansguardian/dansguardian.conf|grep -v '^\ *#' \
|awk -F = '{print $2}'|tr -d \ \'|xargs -r dirname 2>/dev/null`
echo "$logdir"
test -z "$dguser" && dguser=dansguardian
test -z "$dggroup" && dggroup=dansguardian
test -z "$logdir" && logdir=/var/log/dansguardian
chown -R $dguser:$dggroup $logdir
chmod -R u+wr $logdir
chmod u+wrx $logdir
init_failed ()
{
echo "WARNING: Starting dansguardian failed. Please check your configuration."
}
# Automatically added by dh_installinit
if [ -x "/etc/init.d/dansguardian" ]; then
if [ ! -e "/etc/init/dansguardian.conf" ]; then
update-rc.d dansguardian defaults >/dev/null
fi
invoke-rc.d dansguardian start || init_failed
fi
# End automatically added section
|