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

View File

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

View File

@@ -339,7 +339,8 @@ attach_topspeed_console() {
fi fi
clear clear
echo "Attaching to the Top Speed console. Detach with Ctrl-b d." echo "Attaching to the Top Speed console."
echo "To detach from the server and leave it running, press Ctrl+b followed by d."
# `sudoFlags` is initialized by the main launcher before sourcing this file. # `sudoFlags` is initialized by the main launcher before sourcing this file.
# shellcheck disable=SC2154 # shellcheck disable=SC2154
sudo "${sudoFlags[@]}" -u "$topspeedUser" tmux attach-session -t "$topspeedSessionName" sudo "${sudoFlags[@]}" -u "$topspeedUser" tmux attach-session -t "$topspeedSessionName"