#! /bin/sh

set -e

if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
    if [ -x "/usr/bin/systemctl" ]; then
        systemctl --system daemon-reload >/dev/null || true
    fi
fi

if [ "$1" = "remove" ]; then
    if [ -x "/usr/bin/deb-systemd-helper" ]; then
        deb-systemd-helper mask 'wsddn.service' >/dev/null || true
    fi
fi

if [ "$1" = "purge" ]; then
    if [ -x "/usr/bin/deb-systemd-helper" ]; then
        deb-systemd-helper purge 'wsddn.service' >/dev/null || true
        deb-systemd-helper unmask 'wsddn.service' >/dev/null || true
    fi
fi

if [ -x "/usr/sbin/update-rc.d" ] ; then
    update-rc.d wsddn remove || true
fi



exit 0
