[sdnog] shell Script for DNS

Daniel Shaw danielshaw at protonmail.com
Mon Jan 11 08:58:16 SAST 2016


Hi,

Overall your concept looks ok.

###
cp ext.example.sd ext.$new_domain.sd # this is not working :D
###

In the above, how is it not working? That is, I think I understand what you want to happen. But can you give us all a little more details on what *does* happen in reality?

Without more info I can only guess, but one thing you may be running into is your shell misinterpreting where the variable stops and starts and what is part of the string that is not variable name.

If I got lucky and guessed right, then try this:

###
cp ext.example.sd ext.${new_domain}.sd
###


-------- Original Message --------
Subject: [sdnog] shell Script for DNS
Local Time: January 11 2016 10:45 am
UTC Time: January 11 2016 6:45 am
From: manhal_muhamed at hotmail.com
To: sdnog at sdnog.sd



helloooo Sdnoggers ^_^

i have a question on shell scripting :)
i'm trying to make a shell script to change IPs , adding new domains on DNS and many other operations to make it easier for me :D

on "creating new domain" section of this script :

i have a zone file "ext.example.sd"witch i want to copy to the new domain which is a "variable"
so : this is my idea of how this simple section of my script will be :

##########

echo ENTER YOUR DOMAIN :
read new_domain
cp ext.example.sd ext.$new_domain.sd # this is not working :D
sed -i -e 's/20[0-9][0-9]\{6\}/2016011100/g' ext.$new_domain.sd #to reset the serial num

###########
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sdnog.sd/pipermail/sdnog/attachments/20160111/0e095a49/attachment.html>


More information about the sdnog mailing list