1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/sh PID=`ps w | grep "[ /]pppd call $1\( .*\)*\$" | awk '{print $1}'` if test -n "$PID" ; then kill $PID || { echo "$0: kill failed." exit 1 } else echo "$0: I could not find a pppd process for provider '$1'." exit 1 fi exit 0