paulusmack/ppp — pull request #29 by radaiming (2014-12-13 06:46:56+00:00)
Title:  scripts: Avoid killing wrong pppd

poff could kill other pppd processes when there are many pppd running on different serial port. For example, if I run "poff ttyUSB1", pppd running on ttyUSB1, ttyUSB10, ttyUSB13, ttyUSB19 could also be killed.

$ ps axw | grep "pppd call"
1415 ttyUSB25 SNs+ 0:00 /usr/sbin/pppd call ttyUSB25
3692 pts/4 S+ 0:00 grep --colour=auto pppd call
5077 ttyUSB8 SNs+ 0:00 /usr/sbin/pppd call ttyUSB8
5348 ttyUSB0 SNs+ 0:00 /usr/sbin/pppd call ttyUSB0
9297 ttyUSB16 SNs+ 0:00 /usr/sbin/pppd call ttyUSB16
11461 ttyUSB4 SNs+ 0:00 /usr/sbin/pppd call ttyUSB4
12625 ? SNs 0:00 /usr/sbin/pppd call ttyUSB3
13773 ttyUSB22 SNs+ 0:00 /usr/sbin/pppd call ttyUSB22
15972 ttyUSB10 SNs+ 0:00 /usr/sbin/pppd call ttyUSB10
23029 ttyUSB13 SNs+ 0:00 /usr/sbin/pppd call ttyUSB13
24592 ttyUSB19 SNs+ 0:00 /usr/sbin/pppd call ttyUSB19