summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2008-12-18 05:28:01 +0100
committerJames Rayner <james@archlinux.org>2008-12-18 05:28:01 +0100
commit4ea71825696ac78ff5694153f3c70eb0350f6a10 (patch)
tree86330913dfad36b2fa2fcd12393140e5524488bd /src
parentc5019aab33682e9c9e743a761d8616eeb24ce843 (diff)
downloadnetctl-4ea71825696ac78ff5694153f3c70eb0350f6a10.tar.gz
netctl-4ea71825696ac78ff5694153f3c70eb0350f6a10.tar.xz
replace mii link check with iproute
Diffstat (limited to 'src')
-rw-r--r--src/ethernet.subr14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/ethernet.subr b/src/ethernet.subr
index 8823471..e069752 100644
--- a/src/ethernet.subr
+++ b/src/ethernet.subr
@@ -1,15 +1,5 @@
#! /bin/bash
-mii_check() {
- local conn_state=$(mii-tool $1 2> /dev/null)
- local ret=$?
- if echo $conn_state|grep "no link" &> /dev/null; then
- if [[ $ret -eq 0 ]]; then
- return 1
- fi
- fi
- return 0
-}
ethernet_up() {
if [[ ! -e /sys/class/net/$INTERFACE ]]; then
@@ -18,7 +8,7 @@ ethernet_up() {
fi
fi
- if ! mii_check $INTERFACE; then
+ if ! ip link show eth0|grep -q "NO-CARRIER"; then
err_append "No connection available"
return 1
fi
@@ -27,7 +17,7 @@ ethernet_up() {
if checkyesno ${8021X:-no}; then
. /usr/lib/network/wireless.subr
- [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf"
+ [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf"
[[ -z "$WPA_OPTS" ]] && WPA_OPTS="-Dwired"
start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"
if ! wpa_check "$INTERFACE"; then