#!/bin/sh

LINKNAME=eagle-adsl
PIDFILE=/var/run/ppp-eagle-adsl.pid

echo "STOPPED" > /var/run/adiusbadsl

# Stop pppd:
if [ -e $PIDFILE ] ; then
    PPPD_PID=$(head -1 $PIDFILE)
    if pidof pppd | grep -q $PPPD_PID ; then
	logger "Killing pppd started by eagle-adsl"
	kill -INT $PPPD_PID
    fi
fi

# Get the ADI network interface name:
INTERFACE=`/usr/sbin/adictrl -i`
if [ $? = 0 ] ; then
	# Remove the ADI network interface:
	ifconfig $INTERFACE down
fi
