This commit is contained in:
Marc Beninca 2024-04-29 23:07:52 +02:00
parent dac01bb13b
commit 3de8ea1b23
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

19
cd.sh
View file

@ -126,12 +126,7 @@ deb https://deb.debian.org/debian-security bookworm-security main
;; ;;
"alma") "alma")
file="/etc/yum.repos.d/almalinux.repo" file="/etc/yum.repos.d/almalinux.repo"
for expression in \ cd_sed "${file}" "|^m|# m|" "|^# b|b|"
"|^m|# m|" \
"|^# b|b|" \
; do
sed --in-place "s${expression}g" "${file}" || exit
done
cd_cat "${file}" cd_cat "${file}"
;; ;;
*) cd_error_os "cd_set_packages_repositories" ;; *) cd_error_os "cd_set_packages_repositories" ;;
@ -337,6 +332,18 @@ cd_rm () {
fi fi
} }
cd_sed () {
local expression
local file
if [ -f "${1}" ] ; then
file="${1}"
shift
for expression in "${@}" ; do
sed --in-place "s${expression}g" "${file}" || exit
done
fi
}
cd_step () { cd_step () {
if [ "${1}" ] ; then if [ "${1}" ] ; then
CD_STEP=$((CD_STEP+1)) CD_STEP=$((CD_STEP+1))