mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Add logic to show uppercase warning message when appropriate
This commit is contained in:
@@ -160,6 +160,14 @@ fail() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
fqdn_lowercase() {
|
||||
local fqdn=$1
|
||||
|
||||
echo "$fqdn" | grep -qP '(?=^.{4,253}$)(^((?!-)[a-z0-9-]{0,62}[a-z0-9]\.)+[a-z]{2,63}$)' \
|
||||
&& return 0 \
|
||||
|| return 1
|
||||
}
|
||||
|
||||
get_random_value() {
|
||||
length=${1:-20}
|
||||
head -c 5000 /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $length | head -n 1
|
||||
@@ -186,6 +194,12 @@ header() {
|
||||
printf '%s\n' "" "$banner" " $*" "$banner"
|
||||
}
|
||||
|
||||
hostname_lowercase() {
|
||||
local hostname=$1
|
||||
|
||||
[[ $hostname =~ ^[a-z0-9\-]+$ ]] && return 0 || return 1
|
||||
}
|
||||
|
||||
init_monitor() {
|
||||
MONITORNIC=$1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user