MFC revs 1.17-1.20, the functional components of which are:

1.17:
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.

1.18:
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/121452, conf/122127
This commit is contained in:
brooks 2008-04-15 22:37:43 +00:00
parent 84078c0131
commit 99c5271da6

View File

@ -18,20 +18,26 @@ start_postcmd="ppp_poststart"
ppp_start_profile()
{
local _ppp_profile _ppp_mode _ppp_nat
local _ppp_profile _ppp_mode _ppp_nat _ppp_unit
local _ppp_profile_cleaned _punct _punct_c
_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
@ -54,6 +60,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}"