dns/previous

This commit is contained in:
Marc Beninca 2024-05-04 10:45:31 +02:00
parent 8d91c60e2d
commit 213e4e01f5
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

4
cd.sh
View file

@ -174,6 +174,7 @@ local text=""
text="${text}nameserver ${server} text="${text}nameserver ${server}
" "
done done
cd_cat "${CD_DNS_FILE}"
cd_write "${CD_DNS_FILE}" "${text}" cd_write "${CD_DNS_FILE}" "${text}"
} }
@ -405,7 +406,7 @@ local file="${1}"
cd_rm () { cd_rm () {
if [ -e "${1}" ] ; then if [ -e "${1}" ] ; then
echo "$(realpath "${1}")" echo "${1}"
rm --recursive "${1}" || exit rm --recursive "${1}" || exit
fi fi
} }
@ -443,6 +444,7 @@ cd_write () {
local file="${1}" local file="${1}"
local text="${2}" local text="${2}"
if [ "${file}" ] ; then if [ "${file}" ] ; then
echo "${1}"
echo -n "${text}" > "${file}" || exit echo -n "${text}" > "${file}" || exit
cd_cat "${file}" cd_cat "${file}"
fi fi