tlstunnel/debian/postinst

41 lines
1.0 KiB
Plaintext
Raw Normal View History

2023-06-14 19:51:47 +00:00
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
case "$1" in
configure)
# Create tlstunnel user and group
if ! getent group tlstunnel >/dev/null; then
addgroup --system --quiet tlstunnel
fi
if ! getent passwd tlstunnel >/dev/null; then
adduser --quiet \
--system \
--disabled-login \
--no-create-home \
--shell /bin/bash \
--ingroup tlstunnel \
--home /var/lib/tlstunnel \
--gecos "tlstunnel daemon" \
tlstunnel
fi
# Make sure lib directory has correct permissions set
dpkg-statoverride --list "/var/lib/tlstunnel" >/dev/null || \
dpkg-statoverride --add --force --quiet --update tlstunnel adm 0750 /var/lib/tlstunnel
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0