Hi All,
Using slackware12 on my Acer laptop I have setup
acerhk (a program that uses xmodmap to define all of the special keys; e.g. wireless, bluetooth, web, mail etc..), and I have also created a basic network script that brings my eth1 (wireless) up and configures it.
What I currently have working is that when I press the wireless hotkey button; the wireless card enables and the wireless L.E.D. shows activity. Then I have to manually run the script to configure the interface and bring it 'up'
What I am now wondering is how I might go about linking the the script and acerhk together?
So that, if I press the wireless button, the card enables, the led activates, the script gets run [wifi up] which then configures and activates the interface, and I am connected. Also when I am finished, it would be preferable to be able to just press the button again and have the network go down [wifi down] and the card disable.
My network script is as follows:
Quote:
#!/bin/sh
## This script has been created to enable quick Wireless config on an ACER Travelmate.
##
## To enable running as user, add sudo support to /etc/sudoers (see example file).
##
## Usage: wifi up|down
if [ "$1" == "up" ]; then
# /sbin/modprobe ndiswrapper
# sudo /sbin/dhcpcd eth1 -h slack12.0 &
sudo /sbin/ifconfig eth1 192.168.1.64 broadcast 192.168.0.1 netmask 255.255.255.0 up &
sudo /sbin/route add default gw 192.168.1.1 &
# sudo /sbin/iwconfig eth1 nick Weasel &
sudo /sbin/iwconfig eth1 essid Weasel &
# /sbin/iwconfig eth1 key sassword [2]
fi
if [ "$1" == "down" ]; then
sudo /sbin/ifconfig eth1 down
# sudo /sbin/dhcpcd -k
# /sbin/modprobe -r ndiswrapper
fi
|
Also I have setup /etc/sudoers to be able to run the script commands fully as a normal user, so permissions on controlling the network interface is not a problem.
But how I go about linking the two entities together has got me stumped ... any ideas anyone?
Cheers
Orbit