#!/bin/bash
#
# This script is called to stop and clean up after a pppd session
# The clean up is slightly different depending on if you are using
# a TxU/TxP or a DSL-S1 card.  This is identified below.
# This script takes a single parameter, i.e. the farsync interface name
# e.g. hdlc0

echo "Stopping a pppd session using /dev/tty_$1"
eval "`/sbin/farutil $1 shellinfo`"
echo Card type is $CARD
#
# Stop the daemon
# Note that if you are using more than one instance of pppd, then you will
# need to use a different command. killall will kill all pppd processes
#
/usr/bin/killall pppd 
if [ $CARD = "HDSL" ]
then
#
# If you are using a DSL-S1 card use the following
# to stop the dsl line
#
    /sbin/fardsl $1 -t 0
    sleep 5
else
#
# If you have a TxU/TxP cards then there is no specific cleanup required 
#
    echo
fi
exit 0
