summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/ppp
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2008-03-26 21:54:48 +0000
committerbrooks <brooks@FreeBSD.org>2008-03-26 21:54:48 +0000
commitdafcba3dbfc471eed7465489fa4d60bcecf47eb6 (patch)
tree402d02a5a05412d0bb800537d148fad7f271c218 /etc/rc.d/ppp
parent3cbe36127b9fdf1720c93eecf128486487a56c44 (diff)
downloadFreeBSD-src-dafcba3dbfc471eed7465489fa4d60bcecf47eb6.zip
FreeBSD-src-dafcba3dbfc471eed7465489fa4d60bcecf47eb6.tar.gz
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
Diffstat (limited to 'etc/rc.d/ppp')
-rw-r--r--etc/rc.d/ppp9
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/rc.d/ppp b/etc/rc.d/ppp
index 01fc2b1..7d0f9ba 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=$1
+ _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
_ppp_mode=$ppp_mode
fi
# 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
_ppp_nat=$ppp_nat
fi
OpenPOWER on IntegriCloud