#!/bin/sh -e

if [ "$1" = "remove" -o "$1" = "purge" ]; then
# This should be done by dh_suidregister, but suidregester doesn't like
# non-existent files at present, so this mathches the kludge in postinst
  if [ -e /etc/suid.conf -a -x /usr/sbin/suidunregister ]; then
        suidunregister -s ppp /etc/ppp/pap-secrets
        suidunregister -s ppp /etc/ppp/chap-secrets
        suidunregister -s ppp /etc/ppp/peers/provider
        suidunregister -s ppp /etc/chatscripts/provider
  fi
fi

if [ "$1" = "purge" ]; then
  rm -f /etc/ppp/pap-secrets /etc/ppp/chap-secrets
  rm -f /etc/ppp/peers/provider /etc/chatscripts/provider
fi

# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
	update-rc.d ppp remove >/dev/null
fi
# End automatically added section
# Automatically added by dh_installdebconf
if [ "$1" = purge -a -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section
# Automatically added by dh_suidregister
if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
        suidunregister -s ppp /usr/sbin/pppd
fi
# End automatically added section
# Automatically added by dh_suidregister
if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
        suidunregister -s ppp /etc/ppp
fi
# End automatically added section
# Automatically added by dh_suidregister
if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
        suidunregister -s ppp /etc/ppp/peers
fi
# End automatically added section
# Automatically added by dh_suidregister
if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
        suidunregister -s ppp /etc/chatscripts
fi
# End automatically added section

