#!/bin/sh # arpwatch.postinst: v11 2004/09/15 KELEMEN Peter set -e update_ethercodes () { # create or update the database file ethercodes.db; check existence of # the script so it can be disabled using dpkg-divert if [ -x /var/lib/ieee-data/update.d/arpwatch ] ; then /var/lib/ieee-data/update.d/arpwatch \ /var/lib/ieee-data/ oui.txt fi } case "$1" in configure) update_ethercodes ;; triggered) update_ethercodes ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # Automatically added by dh_installsysusers/14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then systemd-sysusers ${DPKG_ROOT:+--root="$DPKG_ROOT"} arpwatch.conf fi # End automatically added section # Automatically added by dh_installtmpfiles/14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then systemd-tmpfiles ${DPKG_ROOT:+--root="$DPKG_ROOT"} --create arpwatch.conf fi # End automatically added section # Automatically added by dh_installinit/14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "$DPKG_ROOT/etc/init.d/arpwatch" ]; then update-rc.d arpwatch defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi if [ -z "$DPKG_ROOT" ]; then invoke-rc.d --skip-systemd-native arpwatch $_dh_action || exit 1 fi fi fi # End automatically added section # Automatically added by dh_installsystemd/14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'arpwatch.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'arpwatch.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'arpwatch.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 'arpwatch.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "$DPKG_ROOT" ] && [ -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 'arpwatch.service' >/dev/null || true fi fi # End automatically added section exit 0 # End of file.