write/previous

This commit is contained in:
Marc Beninca 2024-05-04 10:50:26 +02:00
parent 213e4e01f5
commit 4b47ea99bd
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

5
cd.sh
View file

@ -174,7 +174,6 @@ local text=""
text="${text}nameserver ${server}
"
done
cd_cat "${CD_DNS_FILE}"
cd_write "${CD_DNS_FILE}" "${text}"
}
@ -192,7 +191,8 @@ local file
cd_cat "${file}"
;;
"${CD_OS_DEBIAN}")
cd_write "/etc/apt/sources.list" "\
file="/etc/apt/sources.list"
cd_write "${file}" "\
deb ${CD_OS_REPO} ${CD_OS_VERSION} main
deb ${CD_OS_REPO} ${CD_OS_VERSION}-backports main
deb ${CD_OS_REPO} ${CD_OS_VERSION}-updates main
@ -444,6 +444,7 @@ cd_write () {
local file="${1}"
local text="${2}"
if [ "${file}" ] ; then
[ -f "${file}" ] && cd_cat "${file}"
echo "${1}"
echo -n "${text}" > "${file}" || exit
cd_cat "${file}"