From 4465f7ed22331f4dc4463c28d53ae345508839ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20K=C3=BCthe?= Date: Sun, 2 Jul 2023 17:44:04 +0200 Subject: [PATCH] Extend maxlen script by YAML building function --- build_maxlen_filter.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build_maxlen_filter.sh b/build_maxlen_filter.sh index 6c99d42..2cb458c 100755 --- a/build_maxlen_filter.sh +++ b/build_maxlen_filter.sh @@ -12,6 +12,7 @@ if [ ! "$1" ]; then echo "babeld - [with-deny]" echo "babeld-uci - [with-deny]" echo "bird - [prefix-list]" + echo "yaml" exit 1 fi @@ -41,6 +42,8 @@ for file in *.json; do if [ "$2" == "with-deny" ]; then filter="${filter}config filter\n\toption 'type'\t'in'\n\toption 'ip'\t'$prefix'\n\toption 'action'\t'deny'\n\n" fi + elif [ "$1" == "yaml" ]; then + filter="${filter}- prefix: $prefix\n maxlen: $maxlen\n" fi done done @@ -52,7 +55,7 @@ elif [ "$1" == "babeld-uci" ]; then filter=${filter::-4} elif [ "$1" == "bird" ]; then filter=${filter::-3} -elif [ "$1" == "babeld" ]; then +elif [ "$1" == "babeld" ] || [ "$1" == "yaml" ]; then filter=${filter::-2} fi