LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Simple script issue...I think (https://www.linuxquestions.org/questions/linux-newbie-8/simple-script-issue-i-think-486141/)

chiquitomuir 09-22-2006 08:08 PM

Simple script issue...I think
 
I'm trying to setup a script that runs when my system starts up. I've edited my /etc/rc.d/rc.local file to contain the following:

----------------------------------------------------
#!/bin/bash
#Load ndiswrapper module

echo "Starting Ndiswrapper Driver..."
/sbin/modprobe ndiswrapper


#Setup Essid

echo "Setting up ESSID..."

iwconfig wlan0 essid "ACTIONTEC"



#Setup WEP Key if you have one

#Uncomment below for WEP

echo "Setting up KEY..."

iwconfig wlan0 key XXXX-XXXX-XX



#Setting up DHCP on wlan0

echo "Starting DHCP on wlan0 [ 10 sec timeout ]"

dhcpcd -t 10 wlan0
------------------------------------------------------

Now, when my system starts up, I get the following:

Starting Ndiswrapper Driver...
: command not found
Setting up ESSID...
: command not found
Setting up KEY...
Error for wireless request "Set Encode" (8B2A) :
". invalid argument "XXXX-XXXX-XX
: command not found:
Starting DHCP on wlan0 [ 10 sec timeout ]

I've got to be missing something simple, as when I run these commands from the command line, viola! it all works fine.

Any suggestions? Can anyone spot my problem?

Any help is much appreciated.

Thanks

Nathanael 09-22-2006 08:38 PM

you should supply the full path of the commands you are issuing i.e.

/sbin/iwconfig wlan0 essid "ACTIONTEC"

chiquitomuir 09-22-2006 08:45 PM

I'll try modifying the script...but I don't think it's that, I issued the full path to modprobe and it still said that it couldn't find the command.

Leisy 09-22-2006 08:47 PM

and it is also better to put that in separate file and run that in rc.local (with full path as mentioned before)

chiquitomuir 09-22-2006 09:02 PM

No dice, even w/ the full path it still says it can't find the commands.


All times are GMT -5. The time now is 08:03 PM.