diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/strip-netconf.sh | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tools/strip-netconf.sh b/tools/strip-netconf.sh index 79cf53a..5f8c834 100755 --- a/tools/strip-netconf.sh +++ b/tools/strip-netconf.sh @@ -7,7 +7,7 @@ ls -1 *.conf | while read file; do -e 's/encrypted-password ".+";/encrypted-password "<removed>";/g' \ -e 's/"scp:\/\/.+" password ".+";/"scp:\/\/user\@host\/some\/folder\/" password "<removed>";/g' \ -e 's/serial-number .+;/serial-number <removed>;/g' \ - -e 's/community .+ {/community <removed> {/g' \ + -e 's/community .+ /community <removed> /g' \ -e '/\/\* dat/d' \ -e 's/ecdsa-sha2-nistp256-key .+;/ecdsa-sha2-nistp256-key <removed>;/g' \ -e 's/collector .+;/collector <removed>;/g' \ @@ -17,24 +17,19 @@ ls -1 *.conf | while read file; do $file > tmp/$file # Remove SSH-host-info - sed -i '' \ + sed -i tmp/$file \ -e '/ssh-known-hosts {/ {' -e 'n; s/host .\+ {/host <removed> {/' -e '}' \ tmp/$file - - # Remove stuff from ACL's - sed -i '' \ - -e ':again' -e N -e '$!b again' \ - -e 's/prefix-list mgmt-v4 {[^}]*}/prefix-list mgmt-v4 {\'$'\n'' \/\* KANDU PA-nett (brukt på servere, infra etc) \*\/\'$'\n'' 185.110.148.0\/22;\'$'\n'' }/g' \ - tmp/$file - sed -i '' \ + # Remove stuff from ACL's + sed -i tmp/$file \ -e ':again' -e N -e '$!b again' \ - -e 's/prefix-list mgmt-v6 {[^}]*}/prefix-list mgmt-v6 {\'$'\n'' \/\* KANDU PA-nett (den delen som er brukt på servere, infra etc) \*\/\'$'\n'' 2a06:5841::\/32;\'$'\n'' }/g' \ + -e 's/prefix-list mgmt-v4 {[^}]*}/prefix-list mgmt-v4 {\n }/g' \ tmp/$file - sed -i '' \ + sed -i tmp/$file \ -e ':again' -e N -e '$!b again' \ - -e 's/prefix-list mgmt {[^}]*}/prefix-list mgmt {\'$'\n'' 185.110.148.0\/22;\'$'\n'' 2a06:5841::\/32;\'$'\n'' }/g' \ + -e 's/prefix-list mgmt-v6 {[^}]*}/prefix-list mgmt-v6 {\n }/g' \ tmp/$file done |