check if there are files in yum.repos.d before trying to move them

This commit is contained in:
m0duspwnens
2023-08-03 14:47:53 -04:00
parent 13c3e7f5ff
commit 9172e10dba

View File

@@ -1881,7 +1881,9 @@ securityonion_repo() {
if [[ $is_oracle ]]; then if [[ $is_oracle ]]; then
logCmd "dnf -v clean all" logCmd "dnf -v clean all"
logCmd "mkdir -vp /root/oldrepos" 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 if [[ $is_desktop_iso ]]; then
gpg_rpm_import gpg_rpm_import
if [[ ! $is_airgap ]]; then if [[ ! $is_airgap ]]; then