LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-29-2005, 05:09 PM   #1
chiefreborn
Member
 
Registered: Jun 2005
Location: Ohio
Distribution: OpenSuSE, WHAX, Auditor, Fedora Core, Ubuntu, Knoppix, FIRE, SLAX
Posts: 61

Rep: Reputation: 15
Shell Scripting (For my wireless card stuff)


Okay. So I have the MN-720 and I finally got it working in Linux. (I had to install SuSE over Fedora but who cares!) It runs all by itself, and I have it set to turn on at boot. However, I noticed that it did NOT start up on boot, and I had to 'modprobe ndiswrapper' it again to get it to work. (Yet all of my settings were saved...) Is there a way to automate this for me on boot? I want to make a simple shell script that runs at startup and automates this command for me. I have absolutely NO experience with shell scripting whatsoever. :-D If anyone could help, it would be great.

Thanks!
chiefreborn
 
Old 08-29-2005, 07:36 PM   #2
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
ndiswrapper -m

This command is supposed to insert a line in /etc/modprobe.conf to load ndiswrapper during boot. If that's not working you can add 'modprobe ndiswrapper' to your rc.local file.
 
Old 08-30-2005, 05:05 AM   #3
chiefreborn
Member
 
Registered: Jun 2005
Location: Ohio
Distribution: OpenSuSE, WHAX, Auditor, Fedora Core, Ubuntu, Knoppix, FIRE, SLAX
Posts: 61

Original Poster
Rep: Reputation: 15
Where is the rc.local file? I know there's an rc.splash file (for the main splash loading screen) in /etc but I couldn't find rc.local.

Last edited by chiefreborn; 08-30-2005 at 05:32 AM.
 
Old 08-30-2005, 05:43 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Add the line:
Code:
alias wlan0 ndiswrapper
in your /etc/modprobe.conf as dracolich said.
 
Old 08-30-2005, 02:31 PM   #5
chiefreborn
Member
 
Registered: Jun 2005
Location: Ohio
Distribution: OpenSuSE, WHAX, Auditor, Fedora Core, Ubuntu, Knoppix, FIRE, SLAX
Posts: 61

Original Poster
Rep: Reputation: 15
No no no no no I already have that. I did the ndiswrapper -m a while ago which wrote the alias to a file. I need to put the command 'modprobe ndiswrapper' in some kind of file that runs on boot.
 
Old 08-30-2005, 03:02 PM   #6
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
I just did a real quick google search for the rc.local. This is what I found

http://lists.svlug.org/pipermail/svl...er/038401.html

According to this in suse, the equivalent is called boot.local in the init.d directory

Hope this helps.
 
Old 08-30-2005, 06:04 PM   #7
chiefreborn
Member
 
Registered: Jun 2005
Location: Ohio
Distribution: OpenSuSE, WHAX, Auditor, Fedora Core, Ubuntu, Knoppix, FIRE, SLAX
Posts: 61

Original Poster
Rep: Reputation: 15
Thanks, I'll jump right on that! I'll let you know if it works.
 
Old 08-30-2005, 07:01 PM   #8
ph0b0s
Member
 
Registered: Aug 2005
Location: Belgium
Distribution: Debian, after testing all the others!
Posts: 41

Rep: Reputation: 15
Feel free to adjust this to suit your needs, then put it in /etc/rc.d, make it executable and run it from within /etc/rc.d/network by adding this line to it : cgs-zd1211_control start

Good Luck

-
#! /bin/bash

# wireless activate wireless lan
#
# chkconfig: - 07 93
# description: starts the wireless lan
#
# created 04 June 03
# by George Nimmer george164@earthlink.net

# *******************************************************************************************
# *---> PATCHED ON 15 juli 2005 by ph0b0s (d4rkritu4l@gmail.com) for the Zydas ZD1211 device*
# *---> Checking if device exists has been removed bacause it gave too many errors... *
# *---> Please send comments/suggestions to d4rkritu4l@gmail.com *
# *---> Tested on SUSE 9.3 professional with a zd1211-based Canyon usb stick. *
# *---> For SUSE, you need to configure the wlan device in YAST, but change startup type *
# *---> to MANUAL, and start it with this script instead... *
# *---> - CoDeGuRuS 2005 - *
# *******************************************************************************************

# change this gateway as needed:
GATEWAY=192.168.2.1

# dummy ip ---> needs to be one not used in your network, will be used to temporarily
# give the wlan device an ip adress to prevent routing errors
DUMMY_IP=192.168.2.99

function start() {
#
# Start Wireless Networking
#
echo "+++ Starting WLAN interface..."
/sbin/modprobe -a zd1211
sleep 2
/sbin/ifconfig wlan0 up
sleep 2
/sbin/ifconfig wlan0 $DUMMY_IP
sleep 2
/sbin/ifup wlan0
/sbin/route add default gw $GATEWAY
}
function stop() {
#
# Shut down the WLAN
#
echo "+++ Stopping WLAN..."
/sbin/route del default gw $GATEWAY
/sbin/ifdown wlan0
}

# are-we-running variable
WLANIF=`ifconfig | grep wlan0 | cut -c 1-5`

# See how we were called.
case "$1" in

start)
# Start WLAN if not already running
if [ "$WLANIF" != "wlan0" ]; then
start
else
echo "WLAN is already running!"
fi
;;
stop)
# Stop WLAN
if [ "$WLANIF" = "wlan0" ]; then
stop
else
echo "WLAN is not running!"
fi
;;

restart|reload)
$0 stop
$0 start
;;

status)
if [ "$WLANIF" = "wlan0" ]; then
echo -n "WLAN is running...."
else
echo -n "WLAN not running."
fi
echo
;;

*)
echo "Usage: cgs-zd1211_control {start|stop|restart|status}"
exit 1
esac
exit 0
 
Old 08-30-2005, 07:24 PM   #9
chiefreborn
Member
 
Registered: Jun 2005
Location: Ohio
Distribution: OpenSuSE, WHAX, Auditor, Fedora Core, Ubuntu, Knoppix, FIRE, SLAX
Posts: 61

Original Poster
Rep: Reputation: 15
Thanks, I'll try this out also if the other thing doesn't work.
 
Old 08-31-2005, 06:32 PM   #10
chiefreborn
Member
 
Registered: Jun 2005
Location: Ohio
Distribution: OpenSuSE, WHAX, Auditor, Fedora Core, Ubuntu, Knoppix, FIRE, SLAX
Posts: 61

Original Poster
Rep: Reputation: 15
The boot.local file worked! Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell interface vs shell scripting? I'm confused jcchenz Linux - Software 1 10-26-2005 03:32 PM
shell scripting rch Programming 3 06-07-2003 04:10 AM
Basic shell stuff drsanchez Linux - General 10 05-28-2003 12:49 PM
Shell Scripting - Need some help The Grepper Programming 1 03-29-2002 04:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration