SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

arekm arekm at pld-linux.org
Tue Jun 2 22:34:53 CEST 2009


Author: arekm
Date: Tue Jun  2 22:34:53 2009
New Revision: 10366

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Add rfkill support.

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	Tue Jun  2 22:34:53 2009
@@ -580,6 +580,11 @@
 	local 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?)
+	local output=$(LC_ALL=C 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
 	# XXX: need more generic checks for wifi
 	return 2
 }


More information about the pld-cvs-commit mailing list