registry/check-pol2
lare 1f76bc5adb
[dn42-schema.py] implement find() using git remote
without depending on registry.dn42.us

[dn42-schema.py]: implement _get_parent_inetnums for policy checks of new inetnums

[dn42-schema.py] implement as-block check backend

[dn42-schema.py] implement for route{,6}

[dn42-schema.py] implement @family= without @netlevel

[dn42-schema.py] move new to dn42_schema_local.py + restore dn42-schema.py

[dn42-schema.py] add "check-pol2" using new dn42_schema_local.py
2024-03-19 13:13:14 +01:00

18 lines
466 B
Bash
Executable file

#!/usr/bin/env bash
set -o pipefail
if [ $# -eq 0 ]
then
echo "Usage: $0 COMMIT YOUR-MNT"
exit
fi
BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")"
BASE="$(dirname "$BASE")"
cd "$BASE" || exit 1
git diff --name-only $1 | while IFS='/' read -ra LINE; do
if [[ "${LINE[0]}" = "data" && -n "${LINE[2]}" ]]; then
utils/schema-check/dn42_schema_local.py -v policy ${LINE[1]} ${LINE[2]} $2
fi
done