summaryrefslogtreecommitdiffstats
path: root/src/ethernet.subr
diff options
context:
space:
mode:
Diffstat (limited to 'src/ethernet.subr')
-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