cd_sed
This commit is contained in:
parent
dac01bb13b
commit
3de8ea1b23
1 changed files with 13 additions and 6 deletions
19
cd.sh
19
cd.sh
|
@ -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))
|
||||||
|
|
Loading…
Reference in a new issue