diff options
Diffstat (limited to 'other_scripts/bird2.awk')
-rw-r--r-- | other_scripts/bird2.awk | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/other_scripts/bird2.awk b/other_scripts/bird2.awk new file mode 100644 index 0000000..f61a35c --- /dev/null +++ b/other_scripts/bird2.awk @@ -0,0 +1,29 @@ +# Intended purpose: Pipe birdc s p all into this script - line by line / protocol by protocol + +# initialize variable +BEGIN { + if (!pref) { + pref="^p_"; + } + + proto=""; +} + +# default output for birdc, filter +$1=="BIRD" || $1=="Name" { + next +} + +# if line begins with dn and is a BGP line +$0 ~ pref && $2=="BGP" { + proto=$1 + print "<tr><td>" $1 "</td><td>" $2 "</td><td>" $4 "</td></tr>"; + next +} + +# for every other line "starting" a protocol +/^[a-zA-Z]/ { + # reset proto + proto="" + next +} |