Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 3rd September 2006, 06:30 PM
MaldiGola Offline
Registered User
 
Join Date: Feb 2005
Posts: 35
Bash scripting question

I am running fc5 on my laptop with a Orinoco card using the madwifif drivers. I have a bunch of commands I run to be hooked up to my AP. Sometimes however, I am hardwired into my LAN. I would like to make a bash script that looks to see if eth0 is active or has an IP address if not, then run the neccessary wireless commands.

What is the best way to acheive the eth0 portion of the script?

Thanks in advance.
Reply With Quote
  #2  
Old 3rd September 2006, 06:36 PM
homey Offline
Registered User
 
Join Date: Feb 2005
Posts: 415
Maybe you should have a look at ifplugd.
http://freshmeat.net/projects/ifplugd/
Reply With Quote
  #3  
Old 3rd September 2006, 06:51 PM
MaldiGola Offline
Registered User
 
Join Date: Feb 2005
Posts: 35
That looks cool, thanks.

I would still like to go the script route for educational purposes.


Thanks.
Reply With Quote
  #4  
Old 7th September 2006, 04:26 PM
MaldiGola Offline
Registered User
 
Join Date: Feb 2005
Posts: 35
anyone have an ideas how to do this programatically?
Reply With Quote
  #5  
Old 7th September 2006, 04:59 PM
uth Offline
Registered User
 
Join Date: Jun 2006
Posts: 117
This might be what you want


haveip=$(/sbin/ifconfig eth0 | grep -c inet)
if [ $haveip -eq 0 ]; then
(put your wireless commands here)
fi
Reply With Quote
  #6  
Old 7th September 2006, 05:13 PM
MaldiGola Offline
Registered User
 
Join Date: Feb 2005
Posts: 35
Thanks! I will try it and put my results here.
Reply With Quote
Reply

Tags
bash, question, scripting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash scripting question Reekwind Programming & Packaging 10 16th December 2008 03:31 PM
cron scripting/bash scripting coolbeansdude51 Using Fedora 7 16th January 2007 03:13 AM
Bash scripting question leaded Programming & Packaging 4 17th March 2006 04:15 PM
A question with bash scripting pinenut Using Fedora 3 1st March 2006 08:06 PM
bash scripting... Need your help!!! LA004 Using Fedora 9 3rd May 2005 07:45 AM


Current GMT-time: 06:53 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat