postinst is in inadyn 1.99.4-1.
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | #!/bin/sh
set -e
NAME=inadyn
RUNDIR=/run/$NAME
LOGDIR=/var/log/$NAME
CONF=/etc/$NAME.conf
if [ "$1" = "configure" ]
then
# Create debian-inadyn group if it isn't already there
if ! getent group debian-inadyn >/dev/null
then
# Add system group: debian-inadyn
addgroup --system debian-inadyn >/dev/null
fi
# Create debian-inadyn user if it isn't already there
if ! getent passwd debian-inadyn >/dev/null
then
# Add system user: debian-inadyn
adduser \
--system \
--ingroup debian-inadyn \
--home $RUNDIR \
--no-create-home \
--gecos "inadyn dyndns client" \
--shell /bin/false \
--disabled-login \
--disabled-password \
debian-inadyn >/dev/null
fi
own=`stat --printf="%u" "$CONF" 2>/dev/null`
grp=`stat --printf="%g" "$CONF" 2>/dev/null`
if [ "$own" = "0" -a "$grp" = "0" ]
then
if ! dpkg-statoverride --list $CONF >/dev/null 2>&1
then
dpkg-statoverride --update --add root debian-inadyn 640 $CONF
fi
fi
own=`stat --printf="%u" "$LOGDIR" 2>/dev/null`
grp=`stat --printf="%g" "$LOGDIR" 2>/dev/null`
if [ "$own" = "0" -a "$grp" = "0" ]
then
if ! dpkg-statoverride --list $LOGDIR >/dev/null 2>&1
then
dpkg-statoverride --update --add \
debian-inadyn debian-inadyn 755 $LOGDIR
fi
fi
for item in $LOGDIR/*
do
[ "$item" = "$LOGDIR/*" ] && continue
own=`stat --printf="%u" "$item" 2>/dev/null`
grp=`stat --printf="%g" "$item" 2>/dev/null`
if [ "$own" = "0" -a "$grp" = "0" ]
then
chown debian-inadyn "$item"
chgrp debian-inadyn "$item"
fi
done
if [ -d $RUNDIR ]
then
for item in $RUNDIR $RUNDIR/*
do
[ "$item" = "$RUNDIR/*" ] && continue
own=`stat --printf="%u" "$item" 2>/dev/null`
grp=`stat --printf="%g" "$item" 2>/dev/null`
if [ "$own" = "0" -a "$grp" = "0" ]
then
chown debian-inadyn "$item"
chgrp debian-inadyn "$item"
fi
done
fi
fi
# Automatically added by dh_installinit
if [ -x "/etc/init.d/inadyn" ] || [ -e "/etc/init/inadyn.conf" ]; then
if [ ! -e "/etc/init/inadyn.conf" ]; then
update-rc.d inadyn defaults >/dev/null
fi
invoke-rc.d inadyn start || exit $?
fi
# End automatically added section
exit 0
|