From 4b47ea99bd4713cf5f32148f8142cbadefe53ad4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 10:50:26 +0200 Subject: [PATCH] write/previous --- cd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 7c8fb21..0869fa7 100644 --- a/cd.sh +++ b/cd.sh @@ -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}"