Click to See Complete Forum and Search --> : Adding custom commands to the start up


kondor
09-04-2004, 04:18 PM
hi there, i'm having a little problem (i'm glad it's just little :D) and i was hopping someone here could help me out, since my googling didn't produced much results so far...
i've installed Mandrake10 on my Toshiba laptop, i have a Surecom wireless PCMCIA card, based on the admtek ADM8211 chip, with ndiswrapper (version 0.7) i was able to install the windows driver, and with iwconfig i managed to configure the access to my wireless network. ok so far so good, not much of a problem :p

now my problem is this; for the wireless card to have access to the internet i have to run as root a bunch of commands:

modprobe ndiswrapper
iwconfig wlan0 essid MY_NETWORK
iwconfig wlan0 key on
iwconfig wlan0 key INSERTKEYHERE

after doind all this i can surf the web, but if i reboot, i have to do it all over again, which isn't practical...so my question is this: how/where can i add these commands so they can be executed has root at start up time?

this may seem a very n00b question, but i really don't know! :p :D

thx in advance

fatTrav
09-04-2004, 04:44 PM
you need to add those commands to a start up script.

I don't know which one to tell you to use in Mandrake. on slackware it is rc.local, on gentoo is is local.start. look for something similiar in /etc/init.d or /etc/rc.d

xlilo
09-04-2004, 11:36 PM
ye cd to /etc/init.d and then type pico boot.local (it is posable that it is difrent in your distro) and add the command that starts you network up, for example /etc/init.d/network start then pres ctrl + o then ctrl + x and it should work.

if you have to do all your iwconfig wlan0 setting every time you reboot then type ndiswrapper -m after you finished doing all your iwconfig wlan0 stuff, then do the above to make it start at bootup. everything should be ok then.

kondor
09-05-2004, 11:59 AM
Originally posted by fatTrav
you need to add those commands to a start up script.

I don't know which one to tell you to use in Mandrake. on slackware it is rc.local, on gentoo is is local.start. look for something similiar in /etc/init.d or /etc/rc.d

that's one of the solutions that i found in google, it didn't work, because the iwconfig commands weren't executed as root...that's the only way they can be executed... :(

Originally posted by xlilo
ye cd to /etc/init.d and then type pico boot.local (it is posable that it is difrent in your distro) and add the command that starts you network up, for example /etc/init.d/network start then pres ctrl + o then ctrl + x and it should work.

if you have to do all your iwconfig wlan0 setting every time you reboot then type ndiswrapper -m after you finished doing all your iwconfig wlan0 stuff, then do the above to make it start at bootup. everything should be ok then.

i tried to follow your tip, but i do not have a boot.local in that directory, or any other (i run find and it found nothing)...the ndiswrapper -m also didn't produced any results :(
the network command that you refer already is run at startup

anyway, thx for your input, and for trying to help me!:D

Daedrus
09-05-2004, 01:36 PM
Check under /etc/sysconfig/network. Under SuSE there is a wireless config file here to setup wireless networking. This is also the location of the config files for each of your network card (eth0, etc). I know SuSE handles the naming of these config files a little differently, so I will have to get back to you on the setup of a wireless card config file, but you can add all of your iwconfig settings in a config file here.

In slackware you can edit rc.modules to have it load a particular module. I am not sure what file this would be in Mandrake.