On my webserver there is a directory with about 250 files: *.db
all with the dns of domains. In every file there are nameserver lines like this:
domain.de. 14400 IN NS dns1.name.net.
domain.de. 14400 IN NS dns2.name.net.
domain.de. 14400 IN NS dns3.name.net.
About 140 files do not have the third line.
What I need is small script what:
a. checks if the file has this in it : [url removed, login to view]
b. if so, check if there is also [url removed, login to view]
c. if NOT, then add double line with dns2.name.net.
d. and change [url removed, login to view] in that line to [url removed, login to view]
Simplere solutions are welcome.
PS: bash script or other simple to run on linux server is welcome