Fix carrier_timeout
This commit is contained in:
parent
3a5f03911a
commit
d658c2dc6d
13
sh/net.sh
13
sh/net.sh
@ -59,10 +59,13 @@ _wait_for_carrier() {
|
|||||||
|
|
||||||
_has_carrier && return 0
|
_has_carrier && return 0
|
||||||
|
|
||||||
eval timeout=\$carrier_timeout_${IF_VAR}
|
eval timeout=\$carrier_timeout_${IFVAR}
|
||||||
timeout=${timeout:-5}
|
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) "
|
${efunc} "Waiting for carrier (${timeout} seconds) "
|
||||||
while [ ${timeout} -gt 0 ] ; do
|
while [ ${timeout} -gt 0 ] ; do
|
||||||
sleep 1
|
sleep 1
|
||||||
@ -72,10 +75,10 @@ _wait_for_carrier() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
timeout=$((${timeout} - 1))
|
timeout=$((${timeout} - 1))
|
||||||
[ -z "${RC_EBUFFER}" ] && printf "."
|
[ -z "${RC_EBUFFER}" -a "${RC_PREFIX}" != "yes" ] && printf "."
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -z "${RC_EBUFFER}" ] && echo
|
[ -z "${RC_EBUFFER}" -a "${RC_PREFIX}" != "yes" ] && echo
|
||||||
eend 1
|
eend 1
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user