1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00
freebsd/etc/rc.d/ppp
Brian Somers f6370f2735 Use rc.subr
PR:		72505
Submitted by:	Amir Shalem <amir@active.ath.cx>
2004-12-15 12:39:28 +00:00

49 lines
730 B
Bash

#!/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"