#!/bin/sh
set -e

# Remove the cache file so that the directory can be deleted.
#
if [ "$1" = "remove" -o "$1" = "purge" ]; then
  rm -f /var/cache/ddclient/ddclient.cache
fi

#DEBHELPER#

# Usually the above DEBHELPER magic comment is replaced with some code
# that stops the service. In our case, the --no-start option was used
# to make it possible to conditionally enable the service. The
# --no-start option also disables stopping the service on remove, so
# it has to be manually stopped here.
#### Begin part generated by dh_installsystemd/13.1
if [ -d /run/systemd/system ]; then
  deb-systemd-invoke stop 'ddclient.service' >/dev/null || true
fi
#### End part generated by dh_installsystemd/13.1
#### Begin part generated by dh_installinit/13.1
if [ -x "/etc/init.d/ddclient" ]; then
  invoke-rc.d ddclient stop || exit 1
fi
#### End part generated by dh_installinit/13.1

exit 0
