Hi,
Having trouble in our network we would like to implement a second "ip-helper" (to have DHCP redondancy) to do so we have to take all the network elements config (switches and routers) , finds where the particular config is and add a second line. To do so we need to have a list where this ip-helper line is. but we need also to keep the line where "interface ..." is
basically I need to make a script uising awk or other to do the following :
- open the files one by one and find the "ip-helper ..."
file1
...
interface xxxxxx
ip-helper 10.10.10.1
ip address 192.168.4.4 255.255.255.0
...
or
interface xxxxxx
ip address 192.168.4.4 255.255.255.0
ip-helper 10.10.10.1
file2
...
interface vlan3
ip address 192.168.4.4 255.255.255.0
ip-helper 10.10.10.1
...
then I want to have as a result only one file with
result.txt :
filename1(where the text was found)
interface xxxxxx
ip-helper 10.10.10.1
filename2(where the text was found)
interface xxxxxx
ip-helper 10.10.10.1
...
complex no ?
Any help would be appreciate. I didn't do Scripting since years now and I have just got new job that I would like to keep.
Thanks to every contributors.