Fix manager cron logic

This commit is contained in:
Mike Reeves
2023-09-28 13:06:21 -04:00
parent 95d32cb076
commit ff35946050

View File

@@ -1963,12 +1963,10 @@ securityonion_repo() {
fi fi
if [[ $is_rpm ]]; then logCmd "dnf repolist all"; fi if [[ $is_rpm ]]; then logCmd "dnf repolist all"; fi
if [[ $waitforstate ]]; then if [[ $waitforstate ]]; then
if [[ ! $is_airgap ]]; then if [[ $is_rpm ]]; then
if [[ $is_rpm ]]; then
# Build the repo locally so we can use it # Build the repo locally so we can use it
echo "Syncing Repos" echo "Syncing Repos"
repo_sync_local repo_sync_local
fi
fi fi
fi fi
} }
@@ -1978,7 +1976,7 @@ repo_sync_local() {
if [[ $is_supported ]]; then if [[ $is_supported ]]; then
# Sync the repo from the the SO repo locally. # Sync the repo from the the SO repo locally.
# Check for reposync # Check for reposync
info "Backing up old repos" info "Adding Repo Download Configuration"
mkdir -p /nsm/repo mkdir -p /nsm/repo
mkdir -p /opt/so/conf/reposync/cache mkdir -p /opt/so/conf/reposync/cache
echo "https://repo.securityonion.net/file/so-repo/prod/2.4/oracle/9" > /opt/so/conf/reposync/mirror.txt echo "https://repo.securityonion.net/file/so-repo/prod/2.4/oracle/9" > /opt/so/conf/reposync/mirror.txt
@@ -2002,10 +2000,10 @@ repo_sync_local() {
if [[ ! $is_airgap ]]; then if [[ ! $is_airgap ]]; then
curl --retry 5 --retry-delay 60 -A "netinstall/$SOVERSION/$OS/$(uname -r)/1" https://sigs.securityonion.net/checkup --output /tmp/install curl --retry 5 --retry-delay 60 -A "netinstall/$SOVERSION/$OS/$(uname -r)/1" https://sigs.securityonion.net/checkup --output /tmp/install
logCmd "dnf reposync --norepopath -g --delete -m -c /opt/so/conf/reposync/repodownload.conf --repoid=securityonionsync --download-metadata -p /nsm/repo/" logCmd "dnf reposync --norepopath -g --delete -m -c /opt/so/conf/reposync/repodownload.conf --repoid=securityonionsync --download-metadata -p /nsm/repo/"
# After the download is complete run createrepo
create_repo
fi fi
# After the download is complete run createrepo
create_repo
else else
# Add the proper repos for unsupported stuff # Add the proper repos for unsupported stuff
echo "Adding Repos" echo "Adding Repos"