ive been trying to write a simple (at least i thought it was) script to launch my wireless usb under ubuntu with kde. im using nano.
when i run it from a terminal it works fine, but it just wont run from the script. there is a caveat, but first heres the script.
-------------------------------
#!/bin/bash
sudo ifconfig wlan1 up
sudo iwpriv wlan1 set AuthMode=WPAPSK
sudo iwpriv wlan1 set EncrypType=TKIP
sudo iwpriv wlan1 set WPAPSK=1111111111
sudo iwpriv wlan1 set SSID=network
sudo iwpriv wlan1 set NetworkType=Infra
sudo dhclient wlan1
---------------------------
this is the output
There is already a pid file /var/run/dhclient.pid with pid 13451
Internet Systems Consortium DHCP Client V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit
http://www.isc.org/sw/dhcp/
Listening on LPF/wlan1/(mac is here)
Sending on LPF/wlan1/(mac is here)
Sending on Socket/fallback
DHCPREQUEST of 192.168.0.444 on wlan1 to 255.255.255.255 port 67
DHCPREQUEST of 192.168.0.444 on wlan1 to 255.255.255.255 port 67
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 7
No DHCPOFFERS received.
Trying recorded lease 192.168.1.444
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
--- 192.168.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
No working leases in persistent database - sleeping
--------------------------
now heres the twist:
sometimes it asks for a password, sometimes it doesnt
also, if i run the script up to here:
sudo iwpriv wlan1 set NetworkType=Infra
stop it, and run sudo dhclient wlan1 in a terminal, it works!
ive tried running it with sh script, ./script but still no joy. its probably something simple im just missing but im stumpped.
thanx if anyone has any ideas.