LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2006, 05:50 AM   #1
SirJinX
Member
 
Registered: Jul 2005
Distribution: Fedora Core 4
Posts: 38

Rep: Reputation: 15
Help writing with SH script?


Hi,

I would like to write an SH script that connects me to the internet automatically.
I am using FC4.

Usually, what I have to do is, in the terminal:

Code:
su - root
<password>
ifconfig wlan0 up
iwconfig wlan0 enc <pass> essid <name>
dhcpcd wlan0
The first problem is that it doesn't enter the password :S


And the 2nd one, would I place it in my /etc/init.d folder for it to start the sciprt every time?
 
Old 01-24-2006, 05:57 AM   #2
carl0ski
Member
 
Registered: Sep 2004
Location: Melbourne, Victoria Australia
Distribution: Support those that support you :)
Posts: 872
Blog Entries: 12

Rep: Reputation: 30
Quote:
Originally Posted by SirJinX
Hi,

I would like to write an SH script that connects me to the internet automatically.
I am using FC4.

Usually, what I have to do is, in the terminal:

Code:
su - root
<password>
ifconfig wlan0 up
iwconfig wlan0 enc <pass> essid <name>
dhcpcd wlan0
The first problem is that it doesn't enter the password :S


And the 2nd one, would I place it in my /etc/init.d folder for it to start the sciprt every time?

Code:
!#/bin/bash
ifconfig wlan0 up
iwconfig wlan0 enc <pass> essid <name>
dhcpcd wlan0
save this in a file somewhere
for sake of this

/home/internet.sh.


test it logged in as root or SU
cd /home/;./internet.sh&


if it works
now add it to end of startup file to start at boot.
Code:
echo "cd /home/;./internet.sh&" >>/etc/rc.local
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with writing a script jedimastermopar Linux - General 10 05-02-2005 01:34 PM
Need help writing a script wswartz Linux - Software 3 04-28-2004 03:35 PM
Help writing a rm script VisionZ Linux - Newbie 17 03-24-2004 07:15 AM
Help Writing a script. teeth44 Programming 2 10-14-2003 12:00 PM
writing a Script spanky5125 Linux - Security 5 01-08-2002 09:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:16 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