Compare commits

...

2 Commits

1 changed files with 8 additions and 0 deletions

View File

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