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
ruptime(1)							   User Commands							ruptime(1)

NAME
ruptime - show host status of local machines SYNOPSIS
ruptime [-ar] [-l | -t | -u] DESCRIPTION
The ruptime utility gives a status line like uptime (see uptime(1)) for each machine on the local network; these are formed from packets broadcast by each host on the network approximately every three minutes. Machines for which no status report has been received for 11 minutes are shown as being down. Normally, the listing is sorted by host name, but this order can be changed by specifying one of the options listed below. OPTIONS
The following options are supported: -a Counts even those users who have been idle for an hour or more. -r Reverses the sorting order. -l | -t | -u These options are mutually exclusive. The use of one overrides the previous one(s). -l Sorts the display by load average. -t Sorts the display by up time. -u Sorts the display by number of users. FILES
/var/spool/rwho/whod.* data files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWrcmdc | +-----------------------------+-----------------------------+ SEE ALSO
uptime(1), rwho(1), in.rwhod(1M), attributes(5) SunOS 5.10 6 Nov 2000 ruptime(1)
All times are GMT -4. The time now is 10:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy