mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
refactor(littlesnitch): create new, more strict rules
This commit is contained in:
28
little snitch/rules/build-full-strict-ruleset.sh
Executable file
28
little snitch/rules/build-full-strict-ruleset.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
WORKDIR=$(dirname "$0")
|
||||
|
||||
# Pre-flight checks
|
||||
# -----------------
|
||||
|
||||
# Check files are readable JSON files.
|
||||
PRE_FLIGHT_CHECKS_RESULT=0
|
||||
for FILE in "${WORKDIR}/parts.strict/"*.lsrules
|
||||
do
|
||||
if ! jq '.' "$FILE" > /dev/null
|
||||
then
|
||||
echo "$FILE"
|
||||
PRE_FLIGHT_CHECKS_RESULT=1
|
||||
fi
|
||||
done
|
||||
|
||||
[[ "$PRE_FLIGHT_CHECKS_RESULT" -ne 0 ]] && exit "$PRE_FLIGHT_CHECKS_RESULT"
|
||||
|
||||
# Actual work
|
||||
# -----------
|
||||
|
||||
jq --indent 4 -M \
|
||||
'.rules=([inputs.rules]|flatten)' \
|
||||
"${WORKDIR}/all.strict.lsrules" \
|
||||
"${WORKDIR}/parts.strict/"*.lsrules \
|
||||
| sponge "${WORKDIR}/all.strict.lsrules"
|
||||
Reference in New Issue
Block a user