From 6078935504c752afebefd8e570a6f29f6b05bcdb Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Sun, 2 Feb 2025 14:58:44 +0100 Subject: Various bird stuff (awk) --- other_scripts/bird2.awk | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 other_scripts/bird2.awk (limited to 'other_scripts/bird2.awk') 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 "