mirror of https://codeberg.org/CRXN/entitydb.git
Merge pull request 'maxlen filter script: Add UCI support' (#36) from mark22k/crxn-entitydb:master into master
Reviewed-on: https://codeberg.org/CRXN/entitydb/pulls/36
This commit is contained in:
commit
5e026a49bc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue