[ltp] Using FN+F5 in linux
Kevin Krause
linux-thinkpad@linux-thinkpad.org
Tue, 15 Jun 2004 05:27:17 +0200
Here's what I did:
- add this to /etc/sudoers:
%users ALL=NOPASSWD: /usr/local/bin/togglewlan.sh
- add this to ~/.tpbrc:
WIRELESS /usr/bin/sudo /usr/local/bin/togglewlan.sh
- write this script and put it to /usr/local/bin/togglewlan.sh:
#!/bin/bash
PATH=$PATH":/sbin:/usr/sbin"
if(lsmod | grep ipw2100 > /dev/null); then
dhcpcd -k eth1
ifconfig eth1 down
rmmod ipw2100
else
modprobe ipw2100;
if(dhcpcd -t 5 -T eth1); then
dhcpcd -t 5 eth1
fi
fi
I just finished it and don't have a dhcp server around to test it, but it
should be alright.
Daniel:
> Hi all,
>
> I have a thinkpad T41p. I use wireless at home and occasionally at the
> office. I'd like to be able to use FN+F5 to run a script or un/load the
>
> IPW2100 module.
>
> Any pointers?