#!/bin/sh

# Lets see how many pppds are running....
N=`ls /var/run/ppp* 2>/dev/null| wc -l`

# If there no ppp running then poff does not make much sense
if [ $N = 0 ]; then
	echo "No pppd is running"
	exit 1
fi
# If one is running then it cal be killed with killall
if [ $N = 1 ]; then
	killall pppd
	exit 0
fi
# More than one! Aieehh.. Dont know which one to kill.
echo "More than one pppd running. None stopped"
exit 1
