Merge pull request 'Extend maxlen script by YAML building function' (#39) from mark22k/crxn-entitydb:master into master

Reviewed-on: https://codeberg.org/CRXN/entitydb/pulls/39
This commit is contained in:
Marek Küthe 2023-10-30 18:58:35 +00:00
commit 16ee73b81c
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