ensure createrepo and yum-utils is installed from so repo

This commit is contained in:
m0duspwnens
2022-11-22 11:10:30 -05:00
parent 4b6b42f9b9
commit 6d89d58c50
2 changed files with 9 additions and 20 deletions

View File

@@ -1893,14 +1893,6 @@ securityonion_repo() {
repo_sync_local() {
# Sync the repo from the the SO repo locally.
# Check for reposync
REPOSYNC=$(rpm -qa | grep createrepo | wc -l)
if [[ ! "$REPOSYNC" -gt 0 ]]; then
# Install reposync
info "Installing createrepo"
logCmd "yum -y install yum-utils createrepo"
else
info "We have what we need to sync"
fi
info "Backing up old repos"
mkdir -p /nsm/repo
mkdir -p /root/reposync_cache
@@ -1924,6 +1916,15 @@ repo_sync_local() {
echo "gpgcheck=1" >> /root/repodownload.conf
echo "gpgkey=https://repo.securityonion.net/file/securityonion-repo/keys/securityonion.pub" >> /root/repodownload.conf
REPOSYNC=$(rpm -qa | grep createrepo | wc -l)
if [[ ! "$REPOSYNC" -gt 0 ]]; then
# Install reposync
info "Installing createrepo"
logCmd "yum -y install -c /root/repodownload.conf yum-utils createrepo"
else
info "We have what we need to sync"
fi
logCmd "reposync --norepopath -n -g -l -d -m -c /root/repodownload.conf -r securityonionsync --download-metadata -p /nsm/repo/"