0a9b210037
MFC After: 2 weeks
51 lines
790 B
Bash
51 lines
790 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: ppp
|
|
# REQUIRE: netif isdnd
|
|
# KEYWORD: nojail
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="ppp"
|
|
rcvar=`set_rcvar`
|
|
command="/usr/sbin/${name}"
|
|
start_precmd="ppp_prestart"
|
|
start_postcmd="ppp_poststart"
|
|
|
|
ppp_prestart()
|
|
{
|
|
# 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_poststart()
|
|
{
|
|
# Re-Sync ipfilter and pf so they pick up any new network interfaces
|
|
#
|
|
/etc/rc.d/ipfilter resync
|
|
/etc/rc.d/pf resync
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|