From 9172e10dbabfb7d2217f054da5c89a6a0a4ba541 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 3 Aug 2023 14:47:53 -0400 Subject: [PATCH 1/2] check if there are files in yum.repos.d before trying to move them --- setup/so-functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/so-functions b/setup/so-functions index c8da13043..567584a2f 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1881,7 +1881,9 @@ securityonion_repo() { if [[ $is_oracle ]]; then logCmd "dnf -v clean all" logCmd "mkdir -vp /root/oldrepos" - logCmd "mv -v /etc/yum.repos.d/* /root/oldrepos/" + if [ -n "$(ls -A /etc/yum.repos.d/ 2>/dev/null)" ]; then + logCmd "mv -v /etc/yum.repos.d/* /root/oldrepos/" + fi if [[ $is_desktop_iso ]]; then gpg_rpm_import if [[ ! $is_airgap ]]; then From d40a8927c3c184aa716b37452726175a4d86dedf Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 3 Aug 2023 14:51:43 -0400 Subject: [PATCH 2/2] install salt version specified in master.defaults.yaml for desktop --- setup/so-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/so-functions b/setup/so-functions index 567584a2f..0f73a11a6 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -85,12 +85,13 @@ analyze_system() { desktop_salt_local() { + SALTVERSION=$(egrep 'version: [0-9]{4}' ../salt/salt/master.defaults.yaml | sed 's/^.*version: //') # Install everything using local salt # Set the repo securityonion_repo gpg_rpm_import # Install salt - logCmd "yum -y install salt-minion-3004.1 httpd-tools python3 python36-docker python36-dateutil python36-m2crypto python36-mysql python36-packaging python36-lxml yum-utils device-mapper-persistent-data lvm2 openssl jq" + logCmd "yum -y install salt-minion-$SALTVERSION httpd-tools python3 python36-docker python36-dateutil python36-m2crypto python36-mysql python36-packaging python36-lxml yum-utils device-mapper-persistent-data lvm2 openssl jq" logCmd "yum -y update --exclude=salt*" logCmd "salt-call state.apply desktop --local --file-root=../salt/ -l info"