Compare commits

...

2 Commits

1 changed files with 8 additions and 0 deletions

View File

@ -10,6 +10,7 @@ if [ ! "$1" ]; then
echo ""
echo "Options:"
echo "babeld - [with-deny]"
echo "babeld-uci - [with-deny]"
echo "bird - [prefix-list]"
exit 1
fi
@ -35,6 +36,11 @@ for file in *.json; do
if [ "$2" == "with-deny" ]; then
filter="${filter}in ip $prefix deny\n"
fi
elif [ "$1" == "babeld-uci" ]; then
filter="${filter}config filter\n\toption 'type'\t'in'\n\toption 'ip'\t'$prefix'\n\toption 'le'\t'$maxlen'\n\toption 'action'\t'allow'\n\n"
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
fi
done
done
@ -42,6 +48,8 @@ done
if [ "$filter" == "" ]; then
echo "Failed: Filter seems empty"
exit 1
elif [ "$1" == "babeld-uci" ]; then
filter=${filter::-4}
elif [ "$1" == "bird" ]; then
filter=${filter::-3}
elif [ "$1" == "babeld" ]; then