33 lines
1.4 KiB
Bash
Executable File
33 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
# Automatically added by dh_installsysusers/13.11.4
|
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
|
systemd-sysusers ${DPKG_ROOT:+--root="$DPKG_ROOT"} @@PACKAGEDIR@@.conf
|
|
fi
|
|
|
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
|
if [ -x "$(command -v systemd-tmpfiles)" ]; then
|
|
systemd-tmpfiles ${DPKG_ROOT:+--root="$DPKG_ROOT"} --create @@PACKAGEDIR@@.conf >/dev/null || true
|
|
fi
|
|
fi
|
|
|
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
|
if deb-systemd-helper --quiet is-enabled '@@PACKAGEDIR@@.service'; then
|
|
# Creates new symlinks on upgrades if the unit file has changed.
|
|
deb-systemd-helper enable '@@PACKAGEDIR@@.service' >/dev/null || true
|
|
else
|
|
# Update the statefile to add new symlinks (if any), which need to be
|
|
# cleaned up on purge. Also remove old symlinks.
|
|
deb-systemd-helper update-state '@@PACKAGEDIR@@.service' >/dev/null || true
|
|
fi
|
|
fi
|
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
|
if [ -d /run/systemd/system ]; then
|
|
systemctl --system daemon-reload >/dev/null || true
|
|
if systemctl --system is-active '@@PACKAGEDIR@@.service'; then
|
|
deb-systemd-invoke restart '@@PACKAGEDIR@@.service' >/dev/null || true
|
|
fi
|
|
fi
|
|
fi
|