aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-30 13:17:28 +0000
committerRoy Marples <roy@marples.name>2007-04-30 13:17:28 +0000
commitd658c2dc6d0c5dc13b051d2a31cb762a585e4600 (patch)
tree2c3dd5dfce70e24db36498eaac22a82d5d39956d
parent3a5f03911a3f5c4c9528569fccc73d24f547d534 (diff)
Fix carrier_timeout
-rwxr-xr-xsh/net.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/sh/net.sh b/sh/net.sh
index 9922c7ab..27c81ba1 100755
--- a/sh/net.sh
+++ b/sh/net.sh
@@ -59,10 +59,13 @@ _wait_for_carrier() {
_has_carrier && return 0
- eval timeout=\$carrier_timeout_${IF_VAR}
- timeout=${timeout:-5}
+ eval timeout=\$carrier_timeout_${IFVAR}
+ timeout=${timeout:-${carrier_timeout:-5}}
- [ -n "${RC_EBUFFER}" ] && efunc=einfo
+ # Incase users don't want this nice feature ...
+ [ ${timeout} -le 0 ] && return 0
+
+ [ -n "${RC_EBUFFER}" -o "${RC_PREFIX}" = "yes" ] && efunc=einfo
${efunc} "Waiting for carrier (${timeout} seconds) "
while [ ${timeout} -gt 0 ] ; do
sleep 1
@@ -72,10 +75,10 @@ _wait_for_carrier() {
return 0
fi
timeout=$((${timeout} - 1))
- [ -z "${RC_EBUFFER}" ] && printf "."
+ [ -z "${RC_EBUFFER}" -a "${RC_PREFIX}" != "yes" ] && printf "."
done
- [ -z "${RC_EBUFFER}" ] && echo
+ [ -z "${RC_EBUFFER}" -a "${RC_PREFIX}" != "yes" ] && echo
eend 1
return 1
}