I am creating executable which will be executed with /bin/sh or /bin/bash script,
I have a file which contains a structure like, there will be only one #start and #end tag in the config file, and I want to replace text in between those tags,
...
#start
FirewallRuleSet global {
FirewallRule allow tcp to google.com
FirewallRule allow tcp to facebook.com
#more rules
}
#end
FirewallRuleSet known-users {
FirewallRule allow to 0.0.0.0/0
}
...
Desired output will be,
...
#start
FirewallRuleSet global {
FirewallRule allow tcp to google.com
FirewallRule deny tcp to facebook.com
FirewallRule deny tcp to twitter.com
FirewallRule allow tcp to exaple.com
#more rules
}
#end
FirewallRuleSet known-users {
FirewallRule allow to 0.0.0.0/0
}
...
How can I replace the whole text between #start and #end with some new text? I just want to add or remove Rules from this config file.
This is part of a config file and I want to modify url allowed inside that texts.