diff options
author | brian <brian@FreeBSD.org> | 2004-12-15 12:39:28 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2004-12-15 12:39:28 +0000 |
commit | b90cfd5af47bea5271311f58cccb3af50f87cc0e (patch) | |
tree | a191f2224c9c63e40d8da9cb26e3ce3615e387a1 /etc/rc.d | |
parent | 77a79d83029693fcfd971c9cd31cf61152dd976d (diff) | |
download | FreeBSD-src-b90cfd5af47bea5271311f58cccb3af50f87cc0e.zip FreeBSD-src-b90cfd5af47bea5271311f58cccb3af50f87cc0e.tar.gz |
Use rc.subr
PR: 72505
Submitted by: Amir Shalem <amir@active.ath.cx>
Diffstat (limited to 'etc/rc.d')
-rw-r--r-- | etc/rc.d/ppp | 20 | ||||
-rw-r--r-- | etc/rc.d/ppp-user | 20 |
2 files changed, 20 insertions, 20 deletions
diff --git a/etc/rc.d/ppp b/etc/rc.d/ppp index 305ee1c..f13175c 100644 --- a/etc/rc.d/ppp +++ b/etc/rc.d/ppp @@ -10,11 +10,11 @@ . /etc/rc.subr name="ppp" -rcvar="ppp_enable" -start_cmd="ppp_start" -stop_cmd=":" +rcvar=`set_rcvar` +start_precmd="ppp_precmd" +start_postcmd="ppp_postcmd" -ppp_start() +ppp_precmd() { # Establish ppp mode. # @@ -24,21 +24,21 @@ ppp_start() ppp_mode="auto" fi - ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}" + rc_flags="$rc_flags -quiet -${ppp_mode}" # Switch on NAT mode? # case ${ppp_nat} in [Yy][Ee][Ss]) - ppp_command="${ppp_command} -nat" + rc_flags="$rc_flags -nat" ;; esac - ppp_command="${ppp_command} ${ppp_profile}" - - echo "Starting ppp as \"${ppp_user}\"" - su -m ${ppp_user} -c "exec ${ppp_command}" + rc_flags="$rc_flags ${ppp_profile}" +} +ppp_postcmd() +{ # Re-Sync ipfilter so it picks up any new network interfaces # /etc/rc.d/ipfilter resync diff --git a/etc/rc.d/ppp-user b/etc/rc.d/ppp-user index 305ee1c..f13175c 100644 --- a/etc/rc.d/ppp-user +++ b/etc/rc.d/ppp-user @@ -10,11 +10,11 @@ . /etc/rc.subr name="ppp" -rcvar="ppp_enable" -start_cmd="ppp_start" -stop_cmd=":" +rcvar=`set_rcvar` +start_precmd="ppp_precmd" +start_postcmd="ppp_postcmd" -ppp_start() +ppp_precmd() { # Establish ppp mode. # @@ -24,21 +24,21 @@ ppp_start() ppp_mode="auto" fi - ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}" + rc_flags="$rc_flags -quiet -${ppp_mode}" # Switch on NAT mode? # case ${ppp_nat} in [Yy][Ee][Ss]) - ppp_command="${ppp_command} -nat" + rc_flags="$rc_flags -nat" ;; esac - ppp_command="${ppp_command} ${ppp_profile}" - - echo "Starting ppp as \"${ppp_user}\"" - su -m ${ppp_user} -c "exec ${ppp_command}" + rc_flags="$rc_flags ${ppp_profile}" +} +ppp_postcmd() +{ # Re-Sync ipfilter so it picks up any new network interfaces # /etc/rc.d/ipfilter resync |