#!/bin/sh
# pre-remove script for the Debian GNU/Linux netbase package

set -e

if [ x"$1" = x"upgrade" ];
then
   # portmap needs to get restarted later (in case there are security
   # updates or whatever), but it can't lose its state. So save it *before*
   # doing anything dangerous.
   pmap_dump >/var/run/portmap.upgrade-state

   # /etc/init.d/portmap stop relies on the running portmap being the same
   # one installed in /sbin/portmap. Over an upgrade this doesn't happen,
   # so we kill it here, first.
   /etc/init.d/portmap stop
else
   /etc/init.d/inetd stop
   /etc/init.d/portmap stop
fi

# Automatically added by dh_installdocs
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/netbase ]; then
	rm -f /usr/doc/netbase
fi
# End automatically added section

