Fixed awk bug for firewall rules.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user