Below is the list of steps i need to perform manually as of now and completely new to shell scripting, could you help in writing a shell script to perform the below procedure?
1. Log in to primary DNS server
2. Check /etc/named.conf if zone is already created (grep –i 10.0.11 named.conf)
Eg: if want to add server 10.0.11.13 in to DNS
3. If zone is already there go to /var/named
4. Then add server entry in file db.10.0.11
EG: 13 IN PTR servername.fg.net. And modify the serial number to yyyymmdd as below highlighted.
Suppose if entry is made on 20th November enter the serial number as 20111120
11 IN PTR PSPROA167.fg.net.
12 IN PTR PSPROD055.fg.net.
5. Add entry in db.fg.net (please change serial number here also)
6. Restart dns service -- svcadm restart dns/server
Moderator's Comments:
edit by bakunin: we asked you (in fact several times) to use CODE-tags. What made you think we won't care if you don't? Please use them, we really man it. Thanks.
A shell script is nothing more than commands you would have to type on command line put in a file and made executable using chmod command...
Lets just look at the beginning of your requirement:
Your first request makes us wonder
a) If what you want to be executed is to be on a remote host, what is best?
b) Is this script to be used on may hosts (then it makes sense...) if not will it be reused, if so can it not accept the IP to check/add in parameter?
...
So start by writing down all you will be doing ( all the commands (complete line!)
The best may be that after you re logged on, you type script myscript.out then show us the content so we can help you in your script writing
Appreciate for your suggestions/inputs , below is the detailed steps that are performed and would like to be accomplished using script.
please let me know if this helps?
1. Log in to primary DNS server - Script has to be run both locally and remotely on many servers.
2. Need to check /etc/named.conf file if the zone is already created (grep –i 10.0.11 named.conf)
Eg: if want to add server 10.0.11.13 in to DNS
3. If zone is already existing in the above step when queried, need to go to /var/named directory
4. Then add server entry in file db.10.0.11
EG: 13 IN PTR servername.fg.net. And modify the serial number to yyyymmdd as below highlighted.
Suppose if entry is made on 20th November enter the serial number as 20111120
11 IN PTR PSPROA167.fg.net.
12 IN PTR PSPROD055.fg.net.
5. need to add the entry in db.fg.net and also have to change serial number
6. Restart dns service -- svcadm restart dns/server
Hi, I'm very new to this, so bear with me please.
I want to write a sh script (or if there's a better format please let me know) that allows me to, when I run it, print the date to a file (1.out) take 2 arguments (files a.fa and b.fa), run them with another program, outputting to 2.out, and then... (4 Replies)
Hi, I'm very new to this, so bear with me please.
I want to write a sh script (or if there's a better format please let me know) that allows me to, when I run it, print the date to a file (1.out) take 2 arguments (files a.fa and b.fa), run them with another program, outputting to 2.out, and then... (2 Replies)
Hi
I have two files a.log and b.log . i need to append a.log and b.log so that at the end of first line in a.log i need the append the data of first line from b.log and end of the second line in a.log i need to append the data of second line from b.log and so on up to the end of the file
can... (3 Replies)
I have written a shell script and when i ran the script,for some point of time it is asking to press enter key manually using keyboard.So i need it the enter key in shell itself.
ex : in my shell script,i used the command ssh-keygen -t rsa so it asks the enter 3 times. can you please let me know... (3 Replies)
Can anyone please help me in writing a shell script that would check if a particular user(xyz) has logged in, and if yes, the audit daemon needs to be started. When the user logs off the dameon needs to shutdown , and the report needs to be e-mailed to a set of users. (12 Replies)
Hi,
I am a new for shell script. i need to write script using the following commands
cd /usres/test
# create directory
mkdir temp+DATE( i need to append date )
#moving files from one directory to this directory(we need to check total files in source and taget)
cd /users/sample
... (2 Replies)
Hello ALL,
I am fresher in Unix . i need help to write small shell script . Please help me unix guru.
I am developing the internal site in my office . the data files are generated in one directory everyday .
I have to write shell script to sort those files and put it is internal site .
... (3 Replies)
How to write a shell script file to read 5 numbers using a while loop. Finding the average, maximum and minumum for the numbers.
Any help would be great. (1 Reply)
I have the following output. I want to write a script to check for
1. waits > 0 on all rowsand Ratio > .0. if true then send email.
=========================
ROLLBACK SEGMENT CONTENTION
=========================
If any ratio is > .01 then more rollback segments are needed
NAME ... (1 Reply)