aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOle Mathias Aa. Heggem <olemathias.aa.heggem@gmail.com>2020-04-11 01:06:20 +0200
committerOle Mathias Aa. Heggem <olemathias.aa.heggem@gmail.com>2020-04-11 01:06:20 +0200
commitf5da0d943401e527f5162e9c6344deb65b19b045 (patch)
tree6cecbe12d4f16ce85d4efb8a7a124476d38d52dd /tools
parent38cc638f11c07fdb3d48f7b9ba7e66a2b0faafb6 (diff)
TG19 Netconfig (Better late than never)Pre-TG23master
Diffstat (limited to 'tools')
-rwxr-xr-xtools/strip-netconf.sh19
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