freebsd-dev/etc/rc.d/ppp
Yaroslav Tykhiy 180e996dfc Don't be lazy, set the "command" variable even if
/etc/defaults/rc.conf will provide foo_program, too.
By specifying "command" we explicitly say that we're
going to rely on rc.subr(8) default methods, and
rc.subr(8) will take advantage of this soon.

The majority of our rc.d scripts already set "command"
if appropriate, so fix just the non-compliant handful.
2005-10-23 14:06:53 +00:00

50 lines
754 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ppp-user
# REQUIRE: netif isdnd
# KEYWORD: nojail
. /etc/rc.subr
name="ppp"
rcvar=`set_rcvar`
command="/usr/sbin/ppp"
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"