]> git.ozlabs.org Git - ppp.git/commitdiff
scripts: Avoid killing wrong pppd
authorradaiming <radaiming@gmail.com>
Sat, 13 Dec 2014 06:42:34 +0000 (14:42 +0800)
committerradaiming <radaiming@gmail.com>
Sat, 13 Dec 2014 06:42:34 +0000 (14:42 +0800)
 poff could kill other pppd processes when there are many pppd
 running on different serial port.

Signed-off-by: Ming Dai <radaiming@gmail.com>
scripts/poff

index 3f55a7f40010db8d976d71fb454da725feef4edd..5b45d98a2b6afea557772d07949d1615c12237dd 100644 (file)
@@ -91,7 +91,7 @@ if test "$#" -eq 0 -o "$MODE" = "all" ; then
 fi
 
 # There is an argument, so kill the pppd started on that provider.
-PID=`ps axw | grep "[ /]pppd call $1" | awk '{print $1}'`
+PID=`ps axw | grep "[ /]pppd call $1" | grep -w "$1" | awk '{print $1}'`
 if test -n "$PID" ; then
     $KILL -$SIG $PID || {
         echo "$0: $KILL failed.  None ${DONE}."