pon 970 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. PPP_ON_BOOT=/etc/ppp/ppp_on_boot
  3. case "$1" in
  4. -*) echo "
  5. Usage: pon [provider] [arguments]
  6. If pon is invoked without arguments, $PPP_ON_BOOT file will be
  7. run, presuming it exists and is executable. Otherwise, a PPP connection
  8. will be started using settings from /etc/ppp/peers/provider.
  9. If you specify one argument, a PPP connection will be started using
  10. settings from the appropriate file in the /etc/ppp/peers/ directory, and
  11. any additional arguments supplied will be passed as extra arguments to
  12. pppd.
  13. "
  14. exit 0
  15. ;;
  16. esac
  17. if [ -z "$1" -a -x "$PPP_ON_BOOT" ]; then
  18. exec "$PPP_ON_BOOT"
  19. fi
  20. if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then
  21. echo "
  22. Please configure /etc/ppp/peers/provider or use a command line argument to
  23. use another file in /etc/ppp/peers/ directory.
  24. "
  25. exit 1
  26. fi
  27. if [ "$1" -a ! -f "/etc/ppp/peers/$1" ]; then
  28. echo "
  29. The file /etc/ppp/peers/$1 does not exist.
  30. "
  31. exit 1
  32. fi
  33. exec /usr/sbin/pppd call ${@:-provider}