From d254fd960abe167adbf5caf3492e6c4fe5bdb839 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Wed, 13 Jan 2021 11:04:35 -0500 Subject: [PATCH] [feat] Add message explaining strings cannot contain spaces --- setup/so-functions | 6 +++--- setup/so-whiptail | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index b132ba64d..d31305c5d 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -419,7 +419,7 @@ collect_es_cluster_name() { whiptail_manager_adv_escluster_name while ! valid_string "$ESCLUSTERNAME"; do - whiptail_invalid_input + whiptail_invalid_string "ES cluster name" whiptail_manager_adv_escluster_name done fi @@ -628,7 +628,7 @@ collect_patch_schedule_name_new() { whiptail_patch_name_new_schedule while ! valid_string "$PATCHSCHEDULENAME"; do - whiptail_invalid_input + whiptail_invalid_string "schedule name" whiptail_patch_name_new_schedule done } @@ -637,7 +637,7 @@ collect_patch_schedule_name_import() { whiptail_patch_schedule_import while ! valid_string "$PATCHSCHEDULENAME"; do - whiptail_invalid_input + whiptail_invalid_string "schedule name" whiptail_patch_schedule_import done } diff --git a/setup/so-whiptail b/setup/so-whiptail index c0f7dba17..a182fec5a 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -584,7 +584,14 @@ whiptail_install_type_other() { whiptail_invalid_input() { # TODO: This should accept a list of arguments to specify what general pattern the input should follow [ -n "$TESTING" ] && return - whiptail --title "Security Onion Setup" --msgbox "Invalid input, please try again." 8 75 + whiptail --title "Security Onion Setup" --msgbox " Invalid input, please try again." 7 40 + +} + +whiptail_invalid_string() { + [ -n "$TESTING" ] && return + + whiptail --title "Security Onion Setup" --msgbox "Invalid input, please try again.\n\nThe $1 cannot contain spaces." 9 45 }