[code]sudo find /etc -type f -exec grep -iw ‘wlan’ ‘{}’ ; -print
Motorola 802.11 bg WLAN (TER/GUSB3-E)
/etc/usb_modeswitch.d/148f:2578
AVM Fritz!Wlan USB Stick N
/etc/usb_modeswitch.d/057c:84ff
Zydas ZD1211RW WLAN USB, Sphairon HomeLink 1202 (Variant 1)
/etc/usb_modeswitch.d/0ace:2011
Zydas ZD1211RW WLAN USB, Sphairon HomeLink 1202 (Variant 2)
/etc/usb_modeswitch.d/0ace:20ff
event=button/wlan WLAN 00000080
/etc/acpi/events/asus-wireless-wlan
[/code]
dans cette liste, il n’y a (chez moi) que /etc/acpi/events/asus-wireless-wlan qui est intéressant :
cat /etc/acpi/events/asus-wireless-wlan
event=button/wlan WLAN 00000080
action=/etc/acpi/asus-wireless.sh
Waou ! ça fait peur ! 2 lignes … suivant l “event” cité --> exécuter /etc/acpi/asus-wireless.sh
Bon! ya quoi dans ce script ?
[code]cat /etc/acpi/asus-wireless.sh
#!/bin/sh
Find and toggle wireless devices on Asus laptops
test -f /usr/share/acpi-support/state-funcs || exit 0
. /usr/share/acpi-support/state-funcs
VENDOR=cat /sys/class/dmi/id/sys_vendor | tr [:upper:] [:lower:] | cut -c1-4
test $VENDOR = “asus” || exit 0
if [ “$1” = “” ] ; then
toggleAllWirelessStates;
elif ( isAnyWirelessPoweredOn ) ; then
if [ “$1” = “off” ] ; then
toggleAllWirelessStates;
fi
else
if [ “$1” = “on” ] ; then
toggleAllWirelessStates;
fi
fi
[/code]
Ben pas grand chose en fait ! De ce que je peux voir :
/etc/acpi/asus-wireless.sh --> changer l’état “on” si “off”, et “off” si “on”
/etc/acpi/asus-wireless.sh off --> si une interface est dispo changer son etat (désactiver)
/etc/acpi/asus-wireless.sh on --> changer état interface
ça à l’air un peu tordu, mais t’as qu’a essayer, moi je marrête là parce que si ça ce trouve on n’a pas les même résultat dés ma première recherche avec find, alors …
sinon, pour tester si la carte wifi est on ou off, tu la repère d’adords :
lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 02)
00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 02)
00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)
01:00.0 Network controller: RaLink RT2860
03:00.0 Ethernet controller: Atheros Communications AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0)
chez moi, la carte wifi :
lspci |grep -iw 'ralink'
01:00.0 Network controller: RaLink RT2860
donc pour voir si elle est “on” :
lspci |grep -iqw 'ralink' && echo "Carte Wifi activée"
Carte Wifi activée
si je la désactive :
lspci |grep -iqw 'ralink' && echo "Carte Wifi activée"
$ echo $?
1
C’est un bon point de départ à creuser, tiens, voilà la pelle 