#! /bin/sh
#
# This is the prerm script for the Debian GNU/Linux l2tp-ipsec-vpn package
#
# Written by Werner Jaeger
#
set -e

if [ "$1" = "remove" ] ; then
   # if applet is running try to terminate it
   PIDS=$(pidof L2tpIPsecVpn || true)
   if [ -n "$PIDS" ]; then
      echo "Trying to terminate L2tpIPsecVpn applet" >&2
      kill $PIDS || true
   fi

	# Remove all generated configuration files
   echo "Trying to delete all generated config files" >&2
   L2tpIPsecVpn deleteAllConfFiles || true

   # Remove syslog pipe and restart syslog service
   rm -f /var/log/l2tpipsecvpn.pipe
   invoke-rc.d rsyslog restart || true
fi


# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
