From 60eb1611ea36a512faf017180a73e9c1d50abe1f Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 25 Jul 2023 16:06:38 -0400 Subject: [PATCH] upgrade packages for debian and reboot prior to so installation --- setup/so-setup | 10 ++++++++++ setup/so-whiptail | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/setup/so-setup b/setup/so-setup index bd9347581..47b9416ea 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -86,6 +86,16 @@ if [[ $not_supported ]]; then fi fi +# we need to upgrade packages on debian prior to install and reboot if there are due to iptables-restore not running properly +# if packages are updated and the box isn't rebooted +if [[ $is_debian ]]; then + update_packages + if [[ -f "/var/run/reboot-required" ]]; then + whiptail_debian_reboot_required + reboot + fi +fi + # Check to see if this is the setup type of "desktop". is_desktop= if [ "$setup_type" = 'desktop' ]; then diff --git a/setup/so-whiptail b/setup/so-whiptail index 3c5a2504e..7d3d1b70b 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -27,6 +27,23 @@ whiptail_airgap() { fi } +whiptail_debian_reboot_required() { + + [ -n "$TESTING" ] && return + + read -r -d '' message <<- EOM + + Packages were upgraded and a reboot is required prior to Security Onion installation. + + Press TAB and then the ENTER key to reboot the system. + + Once the reboot has completed, rerun Security Onion setup. + + EOM + + whiptail --title "$whiptail_title" --msgbox "$message" 24 75 --scrolltext +} + whiptail_desktop_install() { [ -n "$TESTING" ] && return