diff --git a/spcd/main.sh b/spcd/main.sh index 418a11d..bb550c6 100644 --- a/spcd/main.sh +++ b/spcd/main.sh @@ -900,7 +900,7 @@ spcd_set_packages_repositories() { "9") spcd_spr__file="/etc/yum.repos.d/almalinux-baseos.repo" ;; *) ;; esac - spcd_sed "${spcd_spr__file}" \ + spcd_os_sed "${spcd_spr__file}" \ "|^mirrorlist|# mirrorlist|" \ "|${SPCD_URL_DEFAULT}|${SPCD_URL_CHOSEN}|" \ "|^# baseurl|baseurl|" @@ -930,7 +930,7 @@ deb ${SPCD_URL_CHOSEN}-security ${SPCD_OS_VERSION}-security main "update-non-oss" \ "update" \ "openh264"; do - spcd_sed "/etc/zypp/repos.d/repo-${spcd_spr__file}.repo" \ + spcd_os_sed "/etc/zypp/repos.d/repo-${spcd_spr__file}.repo" \ "|${SPCD_URL_DEFAULT}|${SPCD_URL_CHOSEN}|" done ;; @@ -940,7 +940,7 @@ deb ${SPCD_URL_CHOSEN}-security ${SPCD_OS_VERSION}-security main "9") spcd_spr__file="/etc/yum.repos.d/rocky.repo" ;; *) ;; esac - spcd_sed "${spcd_spr__file}" \ + spcd_os_sed "${spcd_spr__file}" \ "|^mirrorlist|# mirrorlist|" \ "|${SPCD_URL_DEFAULT}|${SPCD_URL_CHOSEN}|" \ "|^#baseurl|baseurl|" @@ -1123,7 +1123,7 @@ spcd_install_packages() { spcd_install_package "epel-release" [ -n "${SPCD_URL_EPEL}" ] && spcd_ip__epel="${SPCD_URL_EPEL}" || spcd_ip__epel="https://dl.fedoraproject.org" - spcd_sed "/etc/yum.repos.d/epel.repo" \ + spcd_os_sed "/etc/yum.repos.d/epel.repo" \ "|^metalink|# metalink|" \ "|https://download.example|${spcd_ip__epel}|" \ "|^#baseurl|baseurl|" @@ -1230,14 +1230,14 @@ spcd_openssl() { fi } -spcd_sed() { - spcd_sed__file="${1}" +spcd_os_sed() { + spcd_os_sed__file="${1}" shift - if [ -f "${spcd_sed__file}" ]; then - spcd_os_cat "${spcd_sed__file}" - for spcd_sed__regex in "${@}"; do - sed --in-place "s${spcd_sed__regex}g" "${spcd_sed__file}" && - spcd_os_cat "${spcd_sed__file}" || exit + if [ -f "${spcd_os_sed__file}" ]; then + spcd_os_cat "${spcd_os_sed__file}" + for spcd_os_sed__regex in "${@}"; do + sed --in-place "s${spcd_os_sed__regex}g" "${spcd_os_sed__file}" && + spcd_os_cat "${spcd_os_sed__file}" done fi }