V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 39s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 39s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -25,7 +25,7 @@ validation_ipv4() {
|
||||
declare var_ip="$1"
|
||||
### Single-pass check: 4 octets, each 0-255, no leading zeros (unless the octet is exactly "0")
|
||||
if [[ "${var_ip}" =~ ^((25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})$ ]]; then
|
||||
do_log "info" "true" "'${var_ip}' seems to be a valid IPv4."
|
||||
do_log "info" "file_only" "'${var_ip}' seems to be a valid IPv4."
|
||||
else
|
||||
return "${ERR_INVALID_IPV4}"
|
||||
fi
|
||||
@@ -86,7 +86,7 @@ validation_ipv6() {
|
||||
fi
|
||||
|
||||
### Success
|
||||
do_log "info" "true" "'${var_ip}' seems to be a valid IPv6."
|
||||
do_log "info" "file_only" "'${var_ip}' seems to be a valid IPv6."
|
||||
}
|
||||
|
||||
#######################################
|
||||
@@ -101,9 +101,9 @@ validation_ipv6() {
|
||||
validation_port() {
|
||||
declare var_port="$1"
|
||||
if [[ "${var_port}" =~ ^[0-9]+$ ]] && (( var_port >= 1 && var_port <= 65535 )); then
|
||||
do_log "info" "true" "'${var_port}' seems to be a valid port."
|
||||
do_log "info" "file_only" "'${var_port}' seems to be a valid port."
|
||||
else
|
||||
do_log "error" "false" "'${var_port}' seems to be NOT a valid port."
|
||||
do_log "error" "file_only" "'${var_port}' seems to be NOT a valid port."
|
||||
return "${ERR_INVALID_PORT}"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user