Last active
April 11, 2022 07:10
-
-
Save Anillc/a9f5a10340f8f3a241ea1e3e56562308 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo dump | socat stdio tcp6:[::1]:33123 | awk ' | |
BEGIN { | |
i = 0 | |
ORS = "" | |
} | |
{ | |
if ($2 == "route" && $9 == "yes") { | |
if (i == 0) { | |
print "if " | |
} else { | |
print " else if " | |
} | |
print "net = " $5 " then {\n" | |
print " igp_metric = " $13 ";\n" | |
print "}" | |
i++ | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment