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}"