[ltp] Getting ipw3945 kill switch to bring eth1 down?

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Mon, 19 Nov 2007 01:28:38 -0200


On Sun, 18 Nov 2007, Marc MERLIN wrote:
> Besides using a syslog parser to detect the kill switch line and running
> ifconfig eth1 down, is there a better way to do this?

Yes.  Use thinkpad-acpi 0.18 from ibm-acpi.sf.net, open its input device,
and listen for EV_SW SW_RADIO events.  You could also manually poll the
sysfs attribute it exports with the state of the switch (thinkpad-acpi
doesn't support poll() or select() on its attributes yet).

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh