]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/ppp
This commit was generated by cvs2svn to compensate for changes in r136136,
[FreeBSD/FreeBSD.git] / etc / rc.d / ppp
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: ppp-user
7 # REQUIRE: netif isdnd
8 # KEYWORD: FreeBSD nojail
9
10 . /etc/rc.subr
11
12 name="ppp"
13 rcvar="ppp_enable"
14 start_cmd="ppp_start"
15 stop_cmd=":"
16
17 ppp_start()
18 {
19         # Establish ppp mode.
20         #
21         if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
22                 -a "${ppp_mode}" != "dedicated" \
23                 -a "${ppp_mode}" != "background" ]; then
24                 ppp_mode="auto"
25         fi
26
27         ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
28
29         # Switch on NAT mode?
30         #
31         case ${ppp_nat} in
32         [Yy][Ee][Ss])
33                 ppp_command="${ppp_command} -nat"
34                 ;;
35         esac
36
37         ppp_command="${ppp_command} ${ppp_profile}"
38
39         echo "Starting ppp as \"${ppp_user}\""
40         su -m ${ppp_user} -c "exec ${ppp_command}"
41
42         # Re-Sync ipfilter so it picks up any new network interfaces
43         #
44         /etc/rc.d/ipfilter resync
45 }
46
47 load_rc_config $name
48 run_rc_command "$1"