Add a defaultmetric to ppp if we have metric_$IFACE
This commit is contained in:
parent
01ea7e3186
commit
3295a9c0e0
@ -58,7 +58,7 @@ pppd_pre_start() {
|
|||||||
opts="$@"
|
opts="$@"
|
||||||
|
|
||||||
local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersist=false
|
local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersist=false
|
||||||
local hasupdetach=false
|
local hasupdetach=false hasdefaultmetric=false
|
||||||
for i in "$@" ; do
|
for i in "$@" ; do
|
||||||
set -- ${i}
|
set -- ${i}
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -66,6 +66,7 @@ pppd_pre_start() {
|
|||||||
eerror "The option \"$1\" is not allowed in pppd_${IFVAR}"
|
eerror "The option \"$1\" is not allowed in pppd_${IFVAR}"
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
|
defaultmetric) hasdefaultmetric=true ;;
|
||||||
mtu) hasmtu=true ;;
|
mtu) hasmtu=true ;;
|
||||||
mru) hasmru=true ;;
|
mru) hasmru=true ;;
|
||||||
maxfail) hasmaxfail=true ;;
|
maxfail) hasmaxfail=true ;;
|
||||||
@ -84,6 +85,10 @@ pppd_pre_start() {
|
|||||||
opts="${opts} plugin passwordfd.so passwordfd 0"
|
opts="${opts} plugin passwordfd.so passwordfd 0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! ${hasdefaultmetric} ; then
|
||||||
|
local m=\$metric_${IFVAR}
|
||||||
|
[ -n "${m}" ] && opts="${opts} defaultmetric ${m}"
|
||||||
|
fi
|
||||||
if [ -n "${mtu}" ] ; then
|
if [ -n "${mtu}" ] ; then
|
||||||
${hasmtu} || opts="${opts} mtu ${mtu}"
|
${hasmtu} || opts="${opts} mtu ${mtu}"
|
||||||
${hasmru} || opts="${opts} mru ${mtu}"
|
${hasmru} || opts="${opts} mru ${mtu}"
|
||||||
|
Loading…
Reference in New Issue
Block a user