ipv6 support in firewall allow and block lists

This commit is contained in:
Girish Ramakrishnan
2022-02-16 13:09:24 -08:00
parent 426ed435a4
commit 773dfd9a7b
2 changed files with 23 additions and 2 deletions

View File

@@ -23,6 +23,11 @@ if [[ -f "${user_firewall_json}" ]]; then
while read -r line || [[ -n "$line" ]]; do
[[ -z "${line}" ]] && continue # ignore empty lines
[[ "$line" =~ ^#.*$ ]] && continue # ignore lines starting with #
ipset add -! cloudron_blocklist "${line}" # the -! ignore duplicates
if [[ "$line" == *":"* ]]; then
ipset add -! cloudron_blocklist6 "${line}" # the -! ignores duplicates
else
ipset add -! cloudron_blocklist "${line}" # the -! ignores duplicates
fi
done < "${user_firewall_json}"
fi