#!/bin/sh

# PPP-Script 1.0.0
# Written by (Karsten Johansson) ksaj@ims.pcscav.com
# Sat Dec 2, 1995

# Edit 'DEVICE' and 'MODEM' to match your setup...

DEVICE=ppp0
MODEM=cua2
cd /etc/ppp

if [ -r /var/run/$DEVICE.pid ]; then
	/bin/kill -INT `/usr/bin/cat /var/run/$DEVICE.pid`

	if [ ! "$?" = "0" ]; then
		echo "removing stale $DEVICE pid file."
		rm -f /var/run/$DEVICE.pid
                rm -f /var/lock/LCK..$MODEM
		exit 1
	fi

	echo "$DEVICE link terminated"
        rm -f /var/lock/LCK..$MODEM
	exit 0
fi

echo "$DEVICE link is not active"
rm -f /var/lock/LCK..$MODEM
rm -f /var/run/$DEVICE.pid
exit 1

echo -n "" > /etc/ppp-down
