#!/bin/ksh
#
# pppend
#
# Small shell script for cleaning up routes after ppp connection
# has been terminated.
#
# John Roebuck - 16/04/99

echo "\nDeleting ppp net and host entries from route table\n"

#
# Find default gateway and delete it
#
gateway=`netstat -rn |grep default |awk '{print $2}'`
route delete -net 0 $gateway

#
# Find ppp interface route and delete it
#
thisend=`netstat -rn |grep pp0 |awk '{print $2}'`
otherend=`netstat -rn |grep pp0 |awk '{print $1}'`
route delete -host $otherend $thisend

echo " "
netstat -rn