The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Network Card not recognized / How to save network configuration on a Slack Distrib Winol UNIX for Dummies Questions & Answers 1 09-08-2008 02:00 PM
network setup??? arash05 IP Networking 3 06-20-2005 08:03 PM
network setup S26+ SUN Solaris 2 03-13-2005 11:58 PM
Network Setup pkappaz IP Networking 2 05-01-2002 02:53 PM
Multiple Network Card Status Script Krusty Shell Programming and Scripting 1 04-24-2002 08:20 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-22-2009
anargi anargi is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 1
Create a script to setup the network card

Hello!

Trying to build a script which will do the following:

1.) Due to continued stalling after each reboot will consider the uptime of the server and if it is less than 30 sec to load the following settings on your network.

essentially

2.) What interests me primarily is to make a script which only runs to enter the following settings on your network.

--ip
--netmask
--default gw
--key
--essid

or in one way or another.


Code:
#!/bin/bash

if [ uptime <= 30sec ] ; then
echo setup network card

        ifconfig wlan0 192.168.1.101 netmask 255.255.255.0 up;
        route add default gw 192.168.1.1;
        iwconfig wlan0 essid linksys;
        iwconfig wlan0 key 123abcd123;
fi

Can you help me;because this script does not work.

sorry for my bad english.

Now I saw the category shell programming so let's move a mod if you can

Last edited by anargi; 09-22-2009 at 04:29 PM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0