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

12
.vscode/sftp.json vendored
View File

@@ -1,12 +0,0 @@
{
"name": "10.66.166.230",
"host": "10.66.166.230",
"protocol": "sftp",
"port": 22,
"username": "onionuser",
"remotePath": "/home/onionuser/so/",
"uploadOnSave": false,
"useTempFile": false,
"autoDelete": true,
"openSsh": false
}

View File

@@ -1893,14 +1893,6 @@ securityonion_repo() {
repo_sync_local() { repo_sync_local() {
# Sync the repo from the the SO repo locally. # Sync the repo from the the SO repo locally.
# Check for reposync # 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" info "Backing up old repos"
mkdir -p /nsm/repo mkdir -p /nsm/repo
mkdir -p /root/reposync_cache mkdir -p /root/reposync_cache
@@ -1924,6 +1916,15 @@ repo_sync_local() {
echo "gpgcheck=1" >> /root/repodownload.conf echo "gpgcheck=1" >> /root/repodownload.conf
echo "gpgkey=https://repo.securityonion.net/file/securityonion-repo/keys/securityonion.pub" >> /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/" logCmd "reposync --norepopath -n -g -l -d -m -c /root/repodownload.conf -r securityonionsync --download-metadata -p /nsm/repo/"