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