#!/bin/bash set -e addgroup knxd dialout >/dev/null # Force-restart wb-knxd-config if upgrading from old versions. # # Before 1.0.3 service did not start on installation. # In 1.0.3 DEBHELPER placeholder was added, but service was without 'RemainAfterExit', # so 'try-restart' from dh_systemd doesn't actually restart service. # # This was fixed in 1.1.0 by adding 'RemainAfterExit'. if [[ "$1" == "configure" ]] && dpkg --compare-versions "$2" lt "1.1.0~~"; then deb-systemd-invoke restart wb-knxd-config.service >/dev/null || true fi # Automatically added by dh_systemd_enable/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'wb-knxd-config.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'wb-knxd-config.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'wb-knxd-config.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 'wb-knxd-config.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_systemd_start/13.3.4 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 [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'wb-knxd-config.service' >/dev/null || true fi fi # End automatically added section