2002-06-13 22:14:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2005-10-28 16:07:52 +00:00
|
|
|
# PROVIDE: ppp
|
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`
|
2005-10-28 16:10:56 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2004-12-15 12:39:28 +00:00
|
|
|
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()
|
|
|
|
{
|
2006-10-26 00:29:43 +00:00
|
|
|
# Re-Sync ipfilter and pf so they pick up any new network interfaces
|
2002-06-13 22:14:37 +00:00
|
|
|
#
|
|
|
|
/etc/rc.d/ipfilter resync
|
2006-10-26 00:29:43 +00:00
|
|
|
/etc/rc.d/pf resync
|
2002-06-13 22:14:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|