From 4158e18675df7c7374ba0f907321486ec4341b03 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 13 Jul 2023 16:38:51 -0400 Subject: [PATCH] warn of unsupported os --- setup/so-functions | 8 -------- setup/so-setup | 8 ++++++++ setup/so-whiptail | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 605855d36..2c78cd200 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1002,14 +1002,6 @@ detect_os() { fi info "Found OS: $OS $OSVER" - if [[ $is_override ]]; then - unset $not_supported - fi - if [[ $not_supported ]]; then - info "This is not a supported OS. Exiting Setup" - exit 1 - fi - } download_elastic_agent_artifacts() { diff --git a/setup/so-setup b/setup/so-setup index 7bca61628..8fae8fa77 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -64,6 +64,14 @@ done # Let's see what OS we are dealing with here detect_os +if [[ $not_supported ]]; then + if (whiptail_unsupported_os_warning); then + true + else + info "User cancelled setup." + whiptail_cancel + fi +fi # Check to see if this is the setup type of "desktop". is_desktop= diff --git a/setup/so-whiptail b/setup/so-whiptail index 3d760b873..56414f43d 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -1426,6 +1426,27 @@ whiptail_ubuntu_warning() { whiptail --title "$whiptail_title" --msgbox "$message" 14 75 } + +whiptail_unsupported_os_warning() { + + [ -n "$TESTING" ] && return + + read -r -d '' unsupported_os_continue <<- EOM + + WARNING: An unsupported operating system has been detected. + Security Onion may not install or operate as expected. + + Would you like to continue the install? + + EOM + whiptail --title "$whiptail_title" \ + --yesno "$unsupported_os_continue" 14 75 --defaultno + + local exitstatus=$? + return $exitstatus + +} + whiptail_uppercase_warning() { [ -n "$TESTING" ] && return