Sponsored Content
Top Forums UNIX for Advanced & Expert Users Create a script to setup the network card Post 302355407 by anargi on Tuesday 22nd of September 2009 03:21:33 PM
Old 09-22-2009
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..
 

10 More Discussions You Might Find Interesting

1. IP Networking

network card

I have a UnixWare 2 server that has an ISA 3Com NIC that has just a BNC connector on it. I want to remove this and install an ISA 3Com NIC that has a BNC/RJ45 connector. What steps do I have to go through to successfully complete this? Thye are almost the exact same cards except for the... (1 Reply)
Discussion started by: cparks
1 Replies

2. Shell Programming and Scripting

Multiple Network Card Status Script

I have multiple Sun Solaris 8 systems running multiple network cards. (Mix of quad and gig cards.) What I would like to do is create a monitor script to ensure high availability of these cards. Has anyone ever had a situation like this? I was thinking of using the ping command, but am... (1 Reply)
Discussion started by: Krusty
1 Replies

3. IP Networking

Network Setup

I am moving a SUN 250 server from one location to another. The IP address has to change in order to make the server visible in the new building. The system administrator has given me the new IP address for the server, the DNS server IP and the default gateway IP. First question, is this all the... (2 Replies)
Discussion started by: pkappaz
2 Replies

4. UNIX for Dummies Questions & Answers

Installing network card

1) i am trying to install realtek network card in caldrea linux, but i am not able to find the interface, 2)i download drivers for network card and i am not able to read the floopy in linux, pls help me out. (1 Reply)
Discussion started by: gops
1 Replies

5. UNIX for Advanced & Expert Users

Network Card Help

I have been having trouble with my sis900 neytwork card in slacwkare linux. I tried to modprobe the sis900, it didnt give me any errors but it didnt load it. so I put in a realtek 8139 network card and tried it too. These are the errors i get with the two cards when trying to do insmod on either of... (3 Replies)
Discussion started by: The Fridgerator
3 Replies

6. UNIX for Advanced & Expert Users

network card problem

hi, everyone: alpha 600 au true64 Unix 4.0f my network cart is set "Auto-Negotiate".After operate system startup,the network will be disconnected by itself at sometime. I found some prompt in /usr/adm/messages. "tu0 :transmit FIFO underflow:threshold raised to :256 byteŁ¬link up... (1 Reply)
Discussion started by: q30
1 Replies

7. Solaris

network setup

on sparc solairs 2.8 which files i need to configure for network setup: /etc/hosts /etc/defaultrouter /etc/netmasks /et/resolv.conf what els?. by the way, how do i configure for rsh?. like for doing "rsh remotehostname date"?. (2 Replies)
Discussion started by: S26+
2 Replies

8. IP Networking

network setup???

Hello everybody, I am a new unix user (Solaris 10). I was wondering if anybody can help me figure out how to connect to the network in my work place. I know my IP address, subnet mask, gateway, primary and secondary DNS addresses but I don't know how to enter these settings into my Solaris. ... (3 Replies)
Discussion started by: arash05
3 Replies

9. UNIX for Dummies Questions & Answers

How can I tell which network card is which?

I have three network cards in my unix box. I need to figure out which card corresponds to an assigned IP address. If there some command in unix I can use to make an ethernet interface blink? Any advice would be appreciated. (6 Replies)
Discussion started by: mojoman
6 Replies

10. Red Hat

Regarding Network Interface Card

Dear All , While taking backups in one Linux Server , we find one alert came with regard to Network Interface Card. Pl find the below alert. Network Interface Card performance for NIC:eth1 has exceeded Major threshold. Bytes sent and received per second (Average)= 105540.303101... (6 Replies)
Discussion started by: jegaraman
6 Replies
PPPOE-SETUP(8)						      System Manager's Manual						    PPPOE-SETUP(8)

NAME
pppoe-setup - Shell script to configure Roaring Penguin PPPoE client SYNOPSIS
pppoe-setup DESCRIPTION
pppoe-setup is a shell script which prompts you for various pieces of information and sets up an /etc/sysconfig/network-scripts/ifcfg-ppp0 configuration script for the pppoe-start, pppoe-stop and +pppoe-connect scripts. AUTHOR
pppoe-setup was written by David F. Skoll <dfs@roaringpenguin.com>. The pppoe home page is http://www.roaringpenguin.com/pppoe/. SEE ALSO
pppoe(8), pppoe-start(8), pppoe-stop(8), pppoe-connect(8), pppd(8), pppoe.conf(5), pppoe-status(8), pppoe-sniff(8), pppoe-relay(8), pppoe- server(8) 4th Berkeley Distribution 21 February 2000 PPPOE-SETUP(8)
All times are GMT -4. The time now is 03:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy