Sponsored Content
Top Forums Shell Programming and Scripting Need help: Script to edit the hosts, network and eth0 file Post 302217154 by Shaikjaveed on Tuesday 22nd of July 2008 04:22:55 AM
Old 07-22-2008
Error Need help: Script to edit the hosts, network and eth0 file

Hello all Smilie

I am new to scripting. I need somebody to help me write a script that can edit the files.
For eg: if i say ./script <ipadd> <hostname>
then it should change the ipaddress and hostname in the following files:
1. /etc/hosts
2. /etc/sysconfig/network
3. /etc/sysconfig/network-scripts/ifcfg-eth0

I have just started scripting so any help would be greatly appreciated.
Thanks all in advance.
Cheers Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

edit /etc/hosts to show mypc in who

have edit the /etc/hosts as belows 123.45.12.55 mypc so when i do a who, i can see my "mypc" BUT after i changed, i cant see "mypc" do i have to restart anything? (6 Replies)
Discussion started by: yls177
6 Replies

2. Shell Programming and Scripting

How to EDIT file using VI in a script

Hello, How would i go about editing a file using VI within a shell script please? Basically, i want to open a file, clear it's contents and save the file. I found this on the web using "ex" but can't seem to get it to work: ex /home/oconnor/TOOLS/UNIXCMDS/test_ex <<eof_ex dd /*i put... (2 Replies)
Discussion started by: bobk544
2 Replies

3. Red Hat

[tip] network route-eth0

hi, i would like to share this /etc/sysconfig/network-script/route-eth0 GATEWAY0=XXXXXX NETMASK0=XXXXXX ADDRESS0=XXXXXXX a delete route command with "route del -net xxxx...." will work but if the above exist and you reboot the linux then old route will be invoke on that config-route. ... (0 Replies)
Discussion started by: itik
0 Replies

4. Red Hat

SSH broke and network traffic / talking issue between hosts and server

Ok Time warner cable / voip modem feeding Cisco PIX 501 Wan port from PIX 501 LAN port to WAN port on Linksys wrt54GL wireless router. so -->Modem-->PIX 501-->WRT54GL-->Linux Server, wireless desktop, wireless laptop (2), Wireless MAC Pro, Wireless Apple TV, Wireless printer. my... (0 Replies)
Discussion started by: tedeansiii
0 Replies

5. Red Hat

Unable To Activate Ethernet Network Device in RHEL 5.5 - e100 device eth0 does not seem to be presen

Hi All, Could anyone please help to resolve the below problem. I installed RHEL5.5 in my desktop.But when i try to activate the ethernet connection then it gives me the error. I spent 2 days for the above and go through with several suggestion found by googling. But no luck. ... (0 Replies)
Discussion started by: Tanmoy
0 Replies

6. Shell Programming and Scripting

Ssh to 100s of hosts with password in a shell script or text file

I have about 500 hosts where I need to ssh by sending the password on the command line or in a text file in a clear text . However I am not able to download "sshpass" or other tools . Any other ways to pass the password in a script ? (3 Replies)
Discussion started by: gubbu
3 Replies

7. IP Networking

Help with to check the tcp network connectivity between servers and hosts

ello, i am new to the networking side. I have a requirement to check the tcp network connectivity between server it's running on and the list of host's and ports combination. please help me where i am going wrong. my code: #!/bin/bash #read the file line by line cd "$1" cat... (17 Replies)
Discussion started by: sknovice
17 Replies

8. UNIX for Advanced & Expert Users

File edit script exceptions how to pass to script

i wrote script for if file exists script do file edit problem with the script get stuck not existing as for exit i mentioned exit 0 , and how to give the exception for script it should add ./script -- add hi ./script --add "hi how are you" now below script with case it is working for... (0 Replies)
Discussion started by: markjohn1
0 Replies

9. Linux

Is possible to bridge wlan0 and eth0 using network manager?How to for wpa?

I have created a bridge with nmcli between eth0 and wlan0 I use this procedure sudo nmcli con add ifname br0 type bridge con-name br0 sudo nmcli con add type bridge-slave ifname eth0 master br0 sudo nmcli con add type bridge-slave ifname wlan0 master br0 sudo nmcli con modify br0... (1 Reply)
Discussion started by: Linusolaradm1
1 Replies

10. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies
SMPPPD(8)							      SMPPPD								 SMPPPD(8)

NAME
smpppd - SuSE Meta PPP Daemon DESCRIPTION
smpppd is a daemon that controls several internet connections. Use a frontend like cinternet , qinternet or kinternet to control the connections and retrieve status informations. Those frontends can also run on different hosts. The configuration of the dialup connections is done by YaST2 but there are some additional options available in the file /etc/smpppd.conf. smpppd is not intended for direct use. Use rcsmpppd instead. OPTIONS
These options are recognized by smpppd. --detach Detach from the controlling terminal. This is the default. --nodeatch Don't detach from the controlling terminal. -d, --debug Turn on debugging. --version Show program version and exit. --help Show help information and exit. BUGS
ISDN support is poor. SIGNALS
SIGHUP Reload the configuration. FILES
/etc/smpppd.conf Basic configuration. /etc/sysconfig/network/ifcfg-* Configuration files for the interfaces. /etc/sysconfig/network/providers/* Configuration files for the providers. /var/run/smpppd/control Socket to communicate with local frontends. /var/run/smpppd/ifcfg-* Sockets to communicate with backends. SEE ALSO
kinternet, qinternet, accounting(1), cinternet(1), wvdial(1), smpppd.conf(5), pppd(8), smpppd-ifcfg(8). AUTHOR
Arvin Schnell <arvin@suse.de> SuSE September 2003 SMPPPD(8)
All times are GMT -4. The time now is 02:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy