summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-06-06 04:10:05 +0200
committerJames Rayner <james@archlinux.org>2009-06-06 04:10:05 +0200
commit2f40d9375375b9820648d5ae46a60c7f06af1ccc (patch)
tree95bace4424307c853ee97c6ce5094124fa954a4c
parent7045f053192bae2de5445c25458b833bdc723f7e (diff)
downloadnetctl-2f40d9375375b9820648d5ae46a60c7f06af1ccc.tar.gz
netctl-2f40d9375375b9820648d5ae46a60c7f06af1ccc.tar.xz
Another attempt at a working link check, FS#13334
-rw-r--r--Makefile2
-rw-r--r--src/connections/ethernet15
-rw-r--r--src/connections/ethernet-iproute16
3 files changed, 11 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 9180888..e88f681 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,7 @@ tarball:
upload:
md5sum netcfg-$(VERSION)*gz > MD5SUMS.$(VERSION)
- scp netcfg-$(VERSION)*gz MD5SUMS.$(VERSION) archlinux.org:/home/ftp/other/netcfg/
+ scp netcfg-$(VERSION)*gz MD5SUMS.$(VERSION) archlinux.org:/srv/ftp/other/netcfg/
clean:
rm doc/*html
diff --git a/src/connections/ethernet b/src/connections/ethernet
index 6ac3b65..e24e9f5 100644
--- a/src/connections/ethernet
+++ b/src/connections/ethernet
@@ -12,17 +12,12 @@ ethernet_up() {
fi
ip link set $INTERFACE up
+ sleep 1
- let timeout=0
- until ip link show $INTERFACE|grep -q "state UP"
- do
- sleep 0.5
- let timeout++
- if [[ $timeout -eq 5 ]]; then
- err_append "No connection"
- return 1
- fi
- done
+ if ip link show $INTERFACE|grep -q "NO-CARRIER"; then
+ err_append "No connection"
+ return 1
+ fi
if checkyesno "${AUTH8021X:-no}"; then
. "${SUBR_DIR}"/8021x
diff --git a/src/connections/ethernet-iproute b/src/connections/ethernet-iproute
index bb6b152..1a4a6e4 100644
--- a/src/connections/ethernet-iproute
+++ b/src/connections/ethernet-iproute
@@ -19,18 +19,12 @@ ethernet_up() {
fi
ip link set $INTERFACE up
+ sleep 1
- let timeout=0
- until ip link show $INTERFACE|grep -q "state UP"
- do
- sleep 0.5
- let timeout++
- if [[ $timeout -eq 5 ]]; then
- error "No connection"
- return 1
- fi
- done
-
+ if ip link show $INTERFACE|grep -q "NO-CARRIER"; then
+ err_append "No connection"
+ return 1
+ fi
if checkyesno ${AUTH8021X:-no}; then
. ${SUBR_DIR}/8021x