From 564ab105ba71ea595bad839eaefd3eb1696469e2 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Sun, 2 Jul 2023 09:34:14 -0400 Subject: [PATCH] Add some Ubuntu --- setup/so-functions | 11 ++++++++--- setup/so-whiptail | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 4310a7ef8..32eb351f9 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -964,6 +964,11 @@ detect_os() { OS=ubuntu if grep -q "UBUNTU_CODENAME=focal" /etc/os-release; then OSVER=focal + UBVER=20.04 + is_ubuntu=true + elif grep -q "UBUNTU_CODENAME=jammy" /etc/os-release; then + OSVER=jammy + UBVER=22.04 is_ubuntu=true else info "We do not support your current version of Ubuntu." @@ -2023,8 +2028,8 @@ saltify() { #logCmd "wget -q --inet4-only -O /opt/so/gpg/SALTSTACK-GPG-KEY.pub https://repo.securityonion.net/file/securityonion-repo/ubuntu/20.04/amd64/salt/SALTSTACK-GPG-KEY.pub" logCmd "wget -q --inet4-only -O /etc/apt/keyrings/docker.pub https://download.docker.com/linux/ubuntu/gpg" - logCmd "curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023.gpg https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/minor/$SALTVERSION/SALT-PROJECT-GPG-PUBKEY-2023.gpg" - echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg] https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/minor/$SALTVERSION/ focal main" | sudo tee /etc/apt/sources.list.d/salt.list + logCmd "curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2023.gpg https://repo.saltproject.io/salt/py3/ubuntu/$UBVER/amd64/minor/$SALTVERSION/SALT-PROJECT-GPG-PUBKEY-2023.gpg" + echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg] https://repo.saltproject.io/salt/py3/ubuntu/$UBVER/amd64/minor/$SALTVERSION/ focal main" | sudo tee /etc/apt/sources.list.d/salt.list logCmd "apt-key add /etc/apt/keyrings/salt-archive-keyring-2023.gpg" #logCmd "apt-key add /opt/so/gpg/SALTSTACK-GPG-KEY.pub" @@ -2045,7 +2050,7 @@ saltify() { fi - if [[ $is_rocky || $is_centos ]]; then + if [[ $is_rocky || $is_centos || $is_ubuntu ]]; then if [[ $waitforstate ]]; then # install all for a manager logCmd "dnf -y install salt-$SALTVERSION salt-master-$SALTVERSION salt-minion-$SALTVERSION" diff --git a/setup/so-whiptail b/setup/so-whiptail index 3ae14bf65..3d760b873 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -523,7 +523,7 @@ whiptail_install_type() { [ -n "$TESTING" ] && return # What kind of install are we doing? - if [[ $is_rocky || $is_centos ]]; then +# if [[ $is_rocky || $is_centos ]]; then install_type=$(whiptail --title "$whiptail_title" --menu \ "What kind of installation would you like to do?\n\nFor more information, please see:\n$DOC_BASE_URL/architecture.html" 18 65 5 \ "IMPORT" "Import PCAP or log files " \ @@ -533,14 +533,14 @@ whiptail_install_type() { "OTHER" "Other install types" \ 3>&1 1>&2 2>&3 ) - elif [[ $is_ubuntu ]]; then - install_type=$(whiptail --title "$whiptail_title" --menu \ - "What kind of installation would you like to do?\n\nFor more information, please see:\n$DOC_BASE_URL/architecture.html" 18 65 5 \ - "DISTRIBUTED" "Distributed install submenu " \ - "OTHER" "Other install types" \ - 3>&1 1>&2 2>&3 - ) - fi +# elif [[ $is_ubuntu ]]; then +# install_type=$(whiptail --title "$whiptail_title" --menu \ +# "What kind of installation would you like to do?\n\nFor more information, please see:\n$DOC_BASE_URL/architecture.html" 18 65 5 \ +# "DISTRIBUTED" "Distributed install submenu " \ +# "OTHER" "Other install types" \ +# 3>&1 1>&2 2>&3 +# ) +# fi local exitstatus=$? whiptail_check_exitstatus $exitstatus @@ -563,18 +563,18 @@ whiptail_install_type_dist() { [ -n "$TESTING" ] && return - if [[ $is_rocky || $is_centos ]]; then +# if [[ $is_rocky || $is_centos ]]; then dist_option=$(whiptail --title "$whiptail_title" --menu "Do you want to start a new deployment or join this box to \nan existing deployment?" 11 75 2 \ "New Deployment " "Create a new Security Onion deployment" \ "Existing Deployment " "Join to an existing Security Onion deployment " \ 3>&1 1>&2 2>&3 ) - elif [[ $is_ubuntu ]]; then - dist_option=$(whiptail --title "$whiptail_title" --menu "Since this is Ubuntu, this box can only be connected to \nan existing deployment." 11 75 2 \ - "Existing Deployment " "Join to an existing Security Onion deployment " \ - 3>&1 1>&2 2>&3 - ) - fi +# elif [[ $is_ubuntu ]]; then +# dist_option=$(whiptail --title "$whiptail_title" --menu "Since this is Ubuntu, this box can only be connected to \nan existing deployment." 11 75 2 \ +# "Existing Deployment " "Join to an existing Security Onion deployment " \ +# 3>&1 1>&2 2>&3 +# ) +# fi local exitstatus=$? whiptail_check_exitstatus $exitstatus