From fbda9b47041869aca20a660c1b46f5c76c2c2fcb Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 10 Mar 2024 00:17:47 -0500 Subject: [PATCH] handle zone file comments --- cedit | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cedit b/cedit index e6d373c..09d7b82 100755 --- a/cedit +++ b/cedit @@ -53,8 +53,15 @@ section. cedit is short for config edit. local file="$1" local file_name="${file##*/}" - local begin="#_#_# start delimiter of cedit section$name. do not modify. #_#_#" - local end="#_#_# end delimiter of cedit section$name. do not modify. #_#_#" + local comment + comment="#_#_#" + + # bind zone files use ; for comments yes, a little hacky detection. + if [[ $file_name == db.* ]]; then + comment=";;_;_;" + fi + local begin="$comment start delimiter of cedit section$name. do not modify. $comment" + local end="$comment end delimiter of cedit section$name. do not modify. $comment" if [[ ! -e $file_dir ]]; then if ! mkdir -p $file_dir; then -- 2.30.2