summaryrefslogtreecommitdiff
path: root/net.Linux
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-08-07 20:51:08 +0000
committerRoy Marples <roy@marples.name>2007-08-07 20:51:08 +0000
commit3295a9c0e0dc04ca291c5d6f930768d7345dbe01 (patch)
tree94027e2310e51ad6e5e350ca6b974d978a78d840 /net.Linux
parent01ea7e3186fa0169ad4606ed2be87c6f5eedcf2b (diff)
downloadopenrc-3295a9c0e0dc04ca291c5d6f930768d7345dbe01.tar.gz
openrc-3295a9c0e0dc04ca291c5d6f930768d7345dbe01.tar.bz2
openrc-3295a9c0e0dc04ca291c5d6f930768d7345dbe01.tar.xz
Add a defaultmetric to ppp if we have metric_$IFACE
Diffstat (limited to 'net.Linux')
-rw-r--r--net.Linux/pppd.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/net.Linux/pppd.sh b/net.Linux/pppd.sh
index 72acc30..311bb8d 100644
--- a/net.Linux/pppd.sh
+++ b/net.Linux/pppd.sh
@@ -58,7 +58,7 @@ pppd_pre_start() {
opts="$@"
local mtu= hasmtu=false hasmru=false hasmaxfail=false haspersist=false
- local hasupdetach=false
+ local hasupdetach=false hasdefaultmetric=false
for i in "$@" ; do
set -- ${i}
case "$1" in
@@ -66,6 +66,7 @@ pppd_pre_start() {
eerror "The option \"$1\" is not allowed in pppd_${IFVAR}"
return 1
;;
+ defaultmetric) hasdefaultmetric=true ;;
mtu) hasmtu=true ;;
mru) hasmru=true ;;
maxfail) hasmaxfail=true ;;
@@ -84,6 +85,10 @@ pppd_pre_start() {
opts="${opts} plugin passwordfd.so passwordfd 0"
fi
+ if ! ${hasdefaultmetric} ; then
+ local m=\$metric_${IFVAR}
+ [ -n "${m}" ] && opts="${opts} defaultmetric ${m}"
+ fi
if [ -n "${mtu}" ] ; then
${hasmtu} || opts="${opts} mtu ${mtu}"
${hasmru} || opts="${opts} mru ${mtu}"