| 1 | | #!/bin/sh |
|---|
| 2 | | PID=`ps wx | grep "[ /]pppd call $1\( .*\)*\$" | awk '{print $1}'` |
|---|
| 3 | | if test -n "$PID" ; then |
|---|
| 4 | | kill $PID || { |
|---|
| 5 | | echo "$0: kill failed." |
|---|
| 6 | | exit 1 |
|---|
| 7 | | } |
|---|
| 8 | | else |
|---|
| 9 | | echo "$0: I could not find a pppd process for provider '$1'." |
|---|
| 10 | | exit 1 |
|---|
| 11 | | fi |
|---|
| 12 | | exit 0 |
|---|
| | 1 | #!/bin/mksh |
|---|
| | 2 | (busybox ps ww | grep "[ /]pppd call $1\( .*\)*\$") |& |
|---|
| | 3 | found=0 |
|---|
| | 4 | rv=0 |
|---|
| | 5 | while read thepid rest; do |
|---|
| | 6 | if ! kill $thepid; then |
|---|
| | 7 | print -u2 "$0: kill $thepid failed" |
|---|
| | 8 | rv=1 |
|---|
| | 9 | fi |
|---|
| | 10 | found=1 |
|---|
| | 11 | done |
|---|
| | 12 | [[ $found = 1 ]] && exit $rv |
|---|
| | 13 | print -u2 "$0: I could not find a pppd process for provider '$1'." |
|---|
| | 14 | exit 1 |
|---|