diff options
authorBrooks Davis <brooks@FreeBSD.org>2008-03-26 21:54:48 +0000
committerBrooks Davis <brooks@FreeBSD.org>2008-03-26 21:54:48 +0000
commit6ea3dc37463ada83e7b067f1fb973fbc891e3a07 (patch)
parent93f5134aaf829826dbcbea457bfeb27389761854 (diff)
Allow the characters .-+/ to appear in ppp profile names by folding them
to _ when evaluating ppp_<profile>_nat and ppp_<profile>_mode. Document the per-profile variables. PR: conf/121452, conf/122127 (partial) MFC after: 1 week
Notes: svn path=/head/; revision=177649
2 files changed, 31 insertions, 5 deletions
diff --git a/etc/rc.d/ppp b/etc/rc.d/ppp
index 01fc2b19c372..7d0f9baf2989 100644
--- a/etc/rc.d/ppp
+++ b/etc/rc.d/ppp
@@ -21,17 +21,22 @@ ppp_start_profile()
local _ppp_profile _ppp_mode _ppp_nat
+ _ppp_profile_cleaned=$1
+ _punct=". - / +"
+ for _punct_c in $_punct; do
+ _ppp_profile_cleaned=`ltr ${_ppp_profile_cleaned} ${_punct_c} '_'`
+ done
# Check for ppp profile mode override.
- eval _ppp_mode=\$ppp_${_ppp_profile}_mode
+ eval _ppp_mode=\$ppp_${_ppp_profile_cleaned}_mode
if [ -z "$_ppp_mode" ]; then
# Check for ppp profile nat override.
- eval _ppp_nat=\$ppp_${_ppp_profile}_nat
+ eval _ppp_nat=\$ppp_${_ppp_profile_cleaned}_nat
if [ -z "$_ppp_nat" ]; then
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 3c7b67af897b..b6cd48dde44a 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -1315,11 +1315,30 @@ If set to
run the
.Xr ppp 8
+.It Va ppp_profile
+.Pq Vt str
+The name of the profile to use from
+.Pa /etc/ppp/ppp.conf .
+Also used for per-profile overrides of
+.Va ppp_mode
+.Va ppp_nat .
+When the profile name contains any of the characters
+.Dq Li .-/+
+they are translated to
+.Dq Li _
+for the proposes of the override variable names.
.It Va ppp_mode
.Pq Vt str
Mode in which to run the
.Xr ppp 8
+.It Va ppp_ Ns Ao Ar profile Ac Ns _mode
+.Pq Vt str
+Overrides the global
+.Va ppp_mode
+.Ar profile .
Accepted modes are
.Dq Li auto ,
.Dq Li ddial ,
@@ -1336,10 +1355,12 @@ Used in conjunction with
.Va gateway_enable
allows hosts on private network addresses access to the Internet using
this host as a network address translating router.
-.It Va ppp_profile
+.It Va ppp_ Ns Ao Ar profile Ac Ns _nat
.Pq Vt str
-The name of the profile to use from
-.Pa /etc/ppp/ppp.conf .
+Overrides the global
+.Va ppp_nat
+.Ar profile .
.It Va ppp_user
.Pq Vt str
The name of the user under which