Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Enable wireless-killswitch via net. script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
ebfe
n00b
n00b


Joined: 29 Jan 2006
Posts: 20

PostPosted: Fri Oct 06, 2006 9:14 pm    Post subject: [HOWTO] Enable wireless-killswitch via net. script Reply with quote

I got a laptop with an ipw2200 wireless card and use the fsam7400 module to trigger the hardware killswitch on and off, which always annoyed me to do by hand. i've now added the following functions to the the configuration file (/etc/conf.d/net) to do it automagically. it takes use of the preup() and predown() hook functions.

if you don't use the fsam7400 module, you may need to modify the appropriate lines...

Now the killswitch is turned on/off whenever the net-script is called to boot/shutdown the wireless interface.

Code:

preup() {
   if [ -f /sys/class/net/${IFACE}/wireless/status ]
   then
      einfo "Disabling hardware kill-switch"
      if [ -f /proc/driver/wireless/radio ]
      then
         echo 1 > /proc/driver/wireless/radio
      else
         ewarn "The kernel interface for the kill-switch seems to be missing."
      fi
   fi
   return 0
}

predown() {
   if [ -f /sys/class/net/${IFACE}/wireless/status ]
   then
      einfo "Enabling hardware kill-switch"
      if [ -f /proc/driver/wireless/radio ]
      then
         echo 0 > /proc/driver/wireless/radio
      else
         ewarn "The kernel interface for the kill-switch seems to be missing"
      fi
   fi
   return 0
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum