Expand PMF_FN_* macros.
[netbsd-mini2440.git] / etc / rc.d / ppp
blobddcf912e88815d7b926f8e55c4b6049eed757163
1 #!/bin/sh
3 # $NetBSD: ppp,v 1.7 2004/08/13 18:08:03 mycroft Exp $
6 # PROVIDE: ppp
7 # REQUIRE: mountcritremote syslogd
8 # BEFORE: SERVERS
10 # Note that this means that syslogd will not be listening on
11 # any PPP addresses. This is considered a feature.
14 $_rc_subr_loaded . /etc/rc.subr
16 name="ppp"
17 start_cmd="ppp_start"
18 stop_cmd="ppp_stop"
19 sig_stop="-INT"
20 sig_hup="-HUP"
21 hup_cmd="ppp_hup"
22 extra_commands="hup"
24 ppp_start()
26 # /etc/ppp/peers and $ppp_peers contain boot configuration
27 # information for pppd. each value in $ppp_peers that has a
28 # file in /etc/ppp/peers of the same name, will be run as
29 # `pppd call <peer>'.
31 if [ -n "$ppp_peers" ]; then
32 set -- $ppp_peers
33 echo -n "Starting pppd:"
34 while [ $# -ge 1 ]; do
35 peer=$1
36 shift
37 if [ -f /etc/ppp/peers/$peer ]; then
38 pppd call $peer
39 echo -n " $peer"
41 done
42 echo "."
46 ppp_hup()
48 pids="$(check_process pppd)"
49 if [ -n "$pids" ]; then
50 for pid in $pids; do
51 kill $sig_hup $pid
52 done
56 ppp_stop()
58 pids="$(check_process pppd)"
59 if [ -n "$pids" ]; then
60 for pid in $pids; do
61 kill $sig_stop $pid
62 done
66 load_rc_config $name
67 run_rc_command "$1"