SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network
gotar
gotar at pld-linux.org
Mon Nov 16 15:03:50 CET 2009
Author: gotar
Date: Mon Nov 16 15:03:50 2009
New Revision: 10969
Modified:
rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- check rfkill before iwconfig (more common and doesn't require binary)
- note /sys/class/net/${1}/operstate file on some systems
Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.network Mon Nov 16 15:03:50 2009
@@ -577,15 +577,15 @@
check_iwconfig ()
{
local output
- [ -x /sbin/iwconfig ] || return 2
- output=$(LC_ALL=C iwconfig "$1" 2>&1)
- # "radio off" is ipwxxx only "feature" (and there is no "radio on")
- echo "$output" | grep -q "radio off" && return 0
# rfkill state (are there devices with multiple rfkill buttons?)
output=$(cat /sys/class/net/${1}/device/rfkill*/state 2> /dev/null)
# 1 is rfkill not active
[ "$output" = "1" ] && return 1
[ "$output" = "0" -o "$output" = "2" ] && return 0
+ [ -x /sbin/iwconfig ] || return 2
+ output=$(LC_ALL=C iwconfig "$1" 2>&1)
+ # "radio off" is ipwxxx only "feature" (and there is no "radio on")
+ echo "$output" | grep -q "radio off" && return 0
# XXX: need more generic checks for wifi
return 2
}
More information about the pld-cvs-commit
mailing list