#!/bin/sh
#  Pre-removal script for whereami.
# $Id: whereami.prerm,v 1.4 2005/05/15 09:18:01 andrew Exp $

set -e

case "$1" in
    remove|deconfigure)
	set +e
	[ -L /usr/doc/whereami ] && rm -f /usr/doc/whereami
	[ -L /usr/sbin/whereami ] && rm -f /usr/sbin/whereami
  if [ -d /etc/whereami ] ; then
    PRESERVE=`pwd`
    for DDD in /etc/whereami /var/lib/whereami ; do
      cd ${DDD}
      for F in whereiam.sh iam iwas* whereami.started dhclient3.* iwlist.*; do
        [ -f ${F} ] && rm -f ${F}
      done
    done
    cd ${PRESERVE}
  fi
	;;
esac

#DEBHELPER#

