Extend maxlen script by YAML building function

This commit is contained in:
Marek Küthe 2023-07-02 17:44:04 +02:00
parent 9a5e42bee5
commit 4465f7ed22
No known key found for this signature in database
GPG Key ID: 7E869146699108C7
1 changed files with 4 additions and 1 deletions

View File

@ -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