2002-06-13 22:14:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: ppp-user
|
2003-04-18 17:55:05 +00:00
|
|
|
# REQUIRE: netif isdnd
|
2004-10-07 13:55:26 +00:00
|
|
|
# KEYWORD: nojail
|
2002-06-13 22:14:37 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="ppp"
|
2004-12-15 12:39:28 +00:00
|
|
|
rcvar=`set_rcvar`
|
|
|
|
start_precmd="ppp_precmd"
|
|
|
|
start_postcmd="ppp_postcmd"
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2004-12-15 12:39:28 +00:00
|
|
|
ppp_precmd()
|
2002-06-13 22:14:37 +00:00
|
|
|
{
|
|
|
|
# Establish ppp mode.
|
|
|
|
#
|
|
|
|
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
|
2002-10-12 10:31:31 +00:00
|
|
|
-a "${ppp_mode}" != "dedicated" \
|
|
|
|
-a "${ppp_mode}" != "background" ]; then
|
|
|
|
ppp_mode="auto"
|
2002-06-13 22:14:37 +00:00
|
|
|
fi
|
|
|
|
|
2004-12-15 12:39:28 +00:00
|
|
|
rc_flags="$rc_flags -quiet -${ppp_mode}"
|
2002-06-13 22:14:37 +00:00
|
|
|
|
|
|
|
# Switch on NAT mode?
|
|
|
|
#
|
|
|
|
case ${ppp_nat} in
|
|
|
|
[Yy][Ee][Ss])
|
2004-12-15 12:39:28 +00:00
|
|
|
rc_flags="$rc_flags -nat"
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2004-12-15 12:39:28 +00:00
|
|
|
rc_flags="$rc_flags ${ppp_profile}"
|
|
|
|
}
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2004-12-15 12:39:28 +00:00
|
|
|
ppp_postcmd()
|
|
|
|
{
|
2002-06-13 22:14:37 +00:00
|
|
|
# Re-Sync ipfilter so it picks up any new network interfaces
|
|
|
|
#
|
|
|
|
/etc/rc.d/ipfilter resync
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|