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