mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Use rc.subr
PR: 72505 Submitted by: Amir Shalem <amir@active.ath.cx>
This commit is contained in:
parent
44d086bde6
commit
f6370f2735
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138889
@ -146,6 +146,7 @@ gif_interfaces="NO" # List of GIF tunnels (or "NO").
|
||||
|
||||
# User ppp configuration.
|
||||
ppp_enable="NO" # Start user-ppp (or NO).
|
||||
ppp_program="/usr/sbin/ppp" # Path to user-ppp program.
|
||||
ppp_mode="auto" # Choice of "auto", "ddial", "direct" or "dedicated".
|
||||
# For details see man page for ppp(8). Default is auto.
|
||||
ppp_nat="YES" # Use PPP's internal network address translation or NO.
|
||||
|
20
etc/rc.d/ppp
20
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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user