Fixed awk bug for firewall rules.

This commit is contained in:
Storm Dragon
2026-04-17 16:07:15 -04:00
parent 8d1883b26f
commit a5aa2fd63c
3 changed files with 6 additions and 5 deletions

View File

@@ -17,8 +17,8 @@ valid_ipv4_subnet() {
[[ "$subnetValue" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}/([0-9]|[1-2][0-9]|3[0-2])$ ]] || return 1
awk -F '[./]' '
{
for (index = 1; index <= 4; index++) {
if ($index < 0 || $index > 255) {
for (octetIndex = 1; octetIndex <= 4; octetIndex++) {
if ($octetIndex < 0 || $octetIndex > 255) {
exit 1
}
}