summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/ppp-user
blob: f13175cd1b1a77a0571e644d95820e60fd03a25d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: ppp-user
# REQUIRE: netif isdnd
# KEYWORD: nojail

. /etc/rc.subr

name="ppp"
rcvar=`set_rcvar`
start_precmd="ppp_precmd"
start_postcmd="ppp_postcmd"

ppp_precmd()
{
	# Establish ppp mode.
	#
	if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
		-a "${ppp_mode}" != "dedicated" \
		-a "${ppp_mode}" != "background" ]; then
		ppp_mode="auto"
	fi

	rc_flags="$rc_flags -quiet -${ppp_mode}"

	# Switch on NAT mode?
	#
	case ${ppp_nat} in
	[Yy][Ee][Ss])
		rc_flags="$rc_flags -nat"
		;;
	esac

	rc_flags="$rc_flags ${ppp_profile}"
}

ppp_postcmd()
{
	# Re-Sync ipfilter so it picks up any new network interfaces
	#
	/etc/rc.d/ipfilter resync
}

load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud