set -e
case "$1" in
configure)
if command -v systemd-sysusers >/dev/null 2>&1; then
systemd-sysusers byssus.conf
elif ! getent passwd byssus >/dev/null 2>&1; then
useradd --system --user-group --no-create-home --home-dir /nonexistent \
--shell /usr/sbin/nologin --comment "Byssus filesystem attachment daemon" byssus
fi
install -d -o root -g root -m 0755 /etc/byssus /etc/byssus/conf.d
install -d -o byssus -g byssus -m 0750 /var/lib/byssus
if [ -d /run/systemd/system ]; then
systemctl daemon-reload >/dev/null 2>&1 || true
if [ -n "$2" ]; then
systemctl try-restart byssusd.service >/dev/null 2>&1 || true
fi
fi
;;
esac
exit 0