[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 1.1.5-32-g4177736
Damyan Ivanov
dmn at debian.org
Tue Jan 26 06:49:30 UTC 2010
The following commit has been merged in the master branch:
commit 156179d471be2d4c842436ba3476f24a1c92cf6d
Author: Damyan Ivanov <dmn at debian.org>
Date: Tue Jan 26 08:47:00 2010 +0200
detect_rfkill(): extract rfkill index
'eeepc-wlan' is suitable for get_rfkill, but not for set_rfkill
'wlan' and 'wifi' are suitable for set_sfkill, but not for get_rfkill
The index works everywhere
diff --git a/etc/acpi/actions/wireless.sh b/etc/acpi/actions/wireless.sh
index b745aa6..a7cf29d 100755
--- a/etc/acpi/actions/wireless.sh
+++ b/etc/acpi/actions/wireless.sh
@@ -2,7 +2,7 @@
. /usr/share/eeepc-acpi-scripts/functions.sh
-detect_rfkill eeepc-wlan wifi
+detect_rfkill eeepc-wlan
wlan_control="$RFKILL"
if ! have_dev_rfkill; then
diff --git a/functions.sh b/functions.sh
index 4429a4c..959b778 100644
--- a/functions.sh
+++ b/functions.sh
@@ -11,18 +11,16 @@ if have_dev_rfkill; then
detect_rfkill()
{
RFKILL=''
- for i in $@; do
- if rfkill list | grep -q "$i:"; then
- RFKILL="$i"
- break
- fi
- done
+ # expecting something like
+ # 0: eeepc-wlan: Wireless LAN
+ # we want the number before the first colon
+ RFKILL=$(rfkill list | sed "/ $1: / s/:.\\+//; q")
}
get_rfkill()
{
# simple yes/no, so...
- expr 4 - length "$(rfkill list | sed -e "/$1:/! d; N; s/.*://")"
+ expr 4 - length "$(rfkill list | sed -e "/^$1:/! d; N; s/.*://")"
}
set_rfkill()
--
Maintenance of eeepc-acpi-scripts debian package
More information about the Debian-eeepc-commits
mailing list