diff options
author | Thomas D <whissi@whissi.de> | 2014-04-16 11:51:56 +0200 |
---|---|---|
committer | Thomas D <whissi@whissi.de> | 2015-03-10 17:14:49 +0100 |
commit | 50c9fd7827fa58d27a593c8c480068f85c047cec (patch) | |
tree | a48f5245660ff5402f28a4983d1018dd5c6697e2 /net | |
parent | Merge pull request #10 from vapier/master (diff) | |
download | netifrc-50c9fd7827fa58d27a593c8c480068f85c047cec.tar.gz netifrc-50c9fd7827fa58d27a593c8c480068f85c047cec.tar.bz2 netifrc-50c9fd7827fa58d27a593c8c480068f85c047cec.zip |
net/iproute2: Add timeout information and timeout progress indicator
With this patch we will show the currently set dad_timeout value to the
user. The timeout progress will be shown using dots.
The idea is stolen from _wait_for_carrier() in init.d/net.lo.in.
This patch will also undo commit
732a9a4999f479ee97a404252f6a0eba4a86e338
X-Gentoo-Bug: 488250
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=488250
Diffstat (limited to 'net')
-rw-r--r-- | net/iproute2.sh | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/net/iproute2.sh b/net/iproute2.sh index 7918941..8053b2f 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -351,9 +351,10 @@ _iproute2_ipv6_tentative() iproute2_post_start() { - local n= - eval n=\$dad_timeout_${IFVAR} - [ -z "$n" ] && n=${dad_timeout:-10} + local _dad_timeout= + + eval _dad_timeout=\$dad_timeout_${IFVAR} + _dad_timeout=${_dad_timeout:-${dad_timeout:-5}} local policyroute_order= eval policyroute_order=\$policy_rules_before_routes_${IFVAR} @@ -361,14 +362,22 @@ iproute2_post_start() yesno "$policyroute_order" || _iproute2_policy_routing if _iproute2_ipv6_tentative; then - ebegin "Waiting for IPv6 addresses" - while [ $n -ge 0 ]; do + einfon "Waiting for IPv6 addresses (${_dad_timeout} seconds) " + while [ $_dad_timeout -gt 0 ]; do _iproute2_ipv6_tentative || break sleep 1 - : $(( n -= 1 )) + : $(( _dad_timeout -= 1 )) + printf "." done - [ $n -ge 0 ] - eend $? + + echo "" + + if [ $_dad_timeout -le 0 ]; then + eend 1 + return 1 + else + eend 0 + fi fi return 0 |