From: Ian Kelling <iank@fsf.org>
Date: Sun, 10 Mar 2024 05:17:47 +0000 (-0500)
Subject: handle zone file comments
X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=fbda9b47041869aca20a660c1b46f5c76c2c2fcb;p=cedit

handle zone file comments
---

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