PDA

View Full Version : Arrrrgggg....my script won't run from the desktop!



tofergregg
01-09-2005, 07:48 AM
This is probably one of those newbie problems that will seem ridiculous once I start to understand what's going on. I want to run the following script from the KDE desktop (I've installed knoppix on my HD). I simply want to click on it and have it run:


#!/bin/sh
wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
wlanctl-ng wlan0 lnxreq_autojoin ssid=hot authtype=opensystem
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey0=fa:fb:fc:fd:fe
sudo ifconfig wlan0 up
sudo pump -i wlan0
echo done!

I've saved it to my desktop as hotNetwork.sh, and I've changed the permissions to be executable. When I click on it, nothing happens, and it doesn't run the commands in the script. Help?

-Tofer
p.s. I also tried assigning it to open up with "sh" or "bash" via the little wrench tool in the properties box, but that doesn't help.

tofergregg
01-09-2005, 08:16 AM
Ah. Paths. It's all about paths, isn't it? I put in the correct paths (why can't bash figure them out??) as so, linked everything correctly to a shortcut, and it's fine now:



#!/bin/sh
/sbin/wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
/sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid=hot authtype=opensystem
/sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey0=fa:fb:fc:fd:fe
sudo /sbin/ifconfig wlan0 up
sudo /sbin/pump -i wlan0
echo done!

Grr.

-Tofer
[/code]