View Full Version : Batch File Equivalent?
NickS
11-25-2006, 08:54 PM
Hey guys, I'm dabbling with linux and catching on fairly fast. I installed it on my 8 year old laptop (instead of running XP Home :rofl:)
So anyway, I've successfully installed DSL to my HDD, configured ndiswrapper, and installed a few programs. I can't figure out how to have ndiswrapper launch at boot, and quite frankly I don't want to because I don't want to screw anything up.
So, what I'd like to do is make a batch file (shell file?) to do the following, when I double click it.
xset s 0
depmod -a
modprobe ndiswrapper
iwconfig wlan0 essid leethome
iwconfig wlan0 mode Managed
iwconfig wlan0 key open mywepkey
Could someone make me a linux batch type file to do that?
Thanks for all your help,
Nick
You put it into a text file and set execute permissions on it.
chmod a+x myscript
For added spice you add
#! /bin/sh
as the first line.
If you want you can place it somewhere in your $PATH or (recommended) you can put a dir in your homedir where you put all your scripts and that you put into $PATH.
NickS
11-25-2006, 08:58 PM
Wait, huh? That went right over my head. Do you have AIM or MSNM? Cause I really need help..
You can set the execute permissions in the filemanager in file properties, too.
NickS
11-25-2006, 09:11 PM
Can you tell me what to put where? :(
See Attachment :)
Exec, all of them.
And don't call it .bin, it is not a binary file at all. Give it no extension (doesn't matter for it to work, though).
NickS
11-25-2006, 09:46 PM
We got errors, :(
Well, this script needs to execute as superuser. You can't just click it from a non-root account.
Do you have a strategy how you want to control root access on the box?
I'm probably out for tonight.
NickS
11-25-2006, 09:53 PM
Um, whatcha mean by a strategy? Why can't linux make this simple :( lol
EDIT: Launched emelFM as a super user and executed the script. It worked, but it said SET failed on device wlan0; no such device.
How can that be?
Fr3ak
11-26-2006, 01:05 AM
Did you already configure your wlan card and are you sure the right drivers are loaded?
What does "ifconfig" output when you type it in the console?
asmodean
11-26-2006, 04:08 AM
there is a pretty good wlan tool called network-manager for both gnome and kde. Also, can't you just load the module from /etc/modules.conf or smth?
NickS
11-26-2006, 08:22 AM
The card works once I do all that. Works great.
Anyway, when I type in ifconfig, heres what appears.
http://www.nickfire.com/public/ifconfig1.jpg
The batch semi-works anyway. It starts up my wlan card, but setting the settings comes up as SET failed on device wlan0 for some reason. I can enter in the settings by hand though.
Heres iwconfig after I get the net up.
http://www.nickfire.com/public/ifconfig2.jpg
NickS
11-26-2006, 08:33 AM
Wow ok I got it to work by right clicking it and clicking execute in xterm, but I had to do it twice because it went to fast. Is there like something I can type to make it pause for a second or two?
EDIT: also is there any way to create a shortcut to my desktop? Like maybe a second shortcut to aterminal with a command line in it to tell it to exec the batch?
You really want to use a root commandline (xterm etc.) to debug this script first.