diff options
author | brooks <brooks@FreeBSD.org> | 2008-03-28 07:57:52 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2008-03-28 07:57:52 +0000 |
commit | c19e2cda05cf54b8bffe20fcd61dd6879de0aa9c (patch) | |
tree | d54a89ed6645652c2baa4a9325277102f4724ca2 | |
parent | b37acc3c8a0967e0ea1a436c1e7579a3e6d0b164 (diff) | |
download | FreeBSD-src-c19e2cda05cf54b8bffe20fcd61dd6879de0aa9c.zip FreeBSD-src-c19e2cda05cf54b8bffe20fcd61dd6879de0aa9c.tar.gz |
Add support for hardwiring ppp sessions to particular devices with new
per-profile variables of the form ppp_<profile>_unit. No ppp_unit
variable is supported since tying the same unit to more than one profile
won't work.
PR: conf/122127
MFC after: 1 week
-rw-r--r-- | etc/rc.d/ppp | 9 | ||||
-rw-r--r-- | share/man/man5/rc.conf.5 | 10 |
2 files changed, 17 insertions, 2 deletions
diff --git a/etc/rc.d/ppp b/etc/rc.d/ppp index 7d0f9ba..fa4565f 100644 --- a/etc/rc.d/ppp +++ b/etc/rc.d/ppp @@ -18,7 +18,7 @@ start_postcmd="ppp_poststart" ppp_start_profile() { - local _ppp_profile _ppp_mode _ppp_nat + local _ppp_profile _ppp_mode _ppp_nat _ppp_unit _ppp_profile=$1 _ppp_profile_cleaned=$1 @@ -59,6 +59,13 @@ ppp_start_profile() ;; esac + # Check for hard wired unit + eval _ppp_unit=\$ppp_${_ppp_profile_cleaned}_unit + if [ -n "_ppp_unit" ]; then + _ppp_unit="-unit${_ppp_unit}" + fi + rc_flags="$rc_flags $_ppp_unit" + # Run! # su -m $ppp_user -c "$command ${rc_flags} ${_ppp_profile}" diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index b6cd48d..7eba2df 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -1322,7 +1322,9 @@ The name of the profile to use from Also used for per-profile overrides of .Va ppp_mode and -.Va ppp_nat . +.Va ppp_nat , +and +.Va ppp_ Ns Ao Ar profile Ac Ns _unit . When the profile name contains any of the characters .Dq Li .-/+ they are translated to @@ -1361,6 +1363,12 @@ Overrides the global .Va ppp_nat for .Ar profile . +.It Va ppp_ Ns Ao Ar profile Ac Ns _unit +.Pq Vt int +Set the unit number to be used for this profile. +See the manual description of +.Fl unit Ns Ar N +for details. .It Va ppp_user .Pq Vt str The name of the user under which |