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