From 33f396bdaeb53c711645f5a5e07a756dae8c07e0 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 15 Jul 2021 13:53:57 -0400 Subject: [PATCH] Add uppercase warning function --- setup/so-whiptail | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/setup/so-whiptail b/setup/so-whiptail index 0a2e5c53a..693d0554b 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -1844,6 +1844,36 @@ whiptail_suricata_pins() { } +# shellcheck disable=2120 +whiptail_uppercase_warning() { + local type=${1:-hostname} + + local HOSTNAME='TestHostname' + local REDIRECTIT='my.TestDomain.com' + + local msg + if [[ $type == 'hostname' ]]; then + read -r -d '' msg <<- EOM + The value "$HOSTNAME" contains non-lowercase characters. + + Continuing with this hostname could render the system unusable in certain cases, and will also disable the option later in setup to access Security Onion's web interface via the hostname. + EOM + else + read -r -d '' msg <<- EOM + The value "$REDIRECTIT" contains non-lowercase characters. + + Continuing with this value could render the system unusable in certain cases. + EOM + fi + + read -r -d '' msg <<- EOM + $msg + + For best results, it is recommended to only use lowercase ${type}s with Security Onion. For more information see https://docs.securityonion.com/uppercase (URL TBD) + EOM + + whiptail --title "$whiptail_title" --yesno "$msg" --yes-button "Continue anyway" --no-button "Go back" 16 75 +} whiptail_you_sure() {