poff 298 B

1234567891011121314
  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