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")
|
||||
file="/etc/yum.repos.d/almalinux.repo"
|
||||
for expression in \
|
||||
"|^m|# m|" \
|
||||
"|^# b|b|" \
|
||||
; do
|
||||
sed --in-place "s${expression}g" "${file}" || exit
|
||||
done
|
||||
cd_sed "${file}" "|^m|# m|" "|^# b|b|"
|
||||
cd_cat "${file}"
|
||||
;;
|
||||
*) cd_error_os "cd_set_packages_repositories" ;;
|
||||
|
@ -337,6 +332,18 @@ cd_rm () {
|
|||
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 () {
|
||||
if [ "${1}" ] ; then
|
||||
CD_STEP=$((CD_STEP+1))
|
||||
|
|
Loading…
Reference in a new issue