From 4e03fcda831ff30e4db1d3165f2475db1bfd2e29 Mon Sep 17 00:00:00 2001 From: nhyatt Date: Tue, 23 Jan 2024 21:29:22 -0600 Subject: [PATCH] deal with dig txt format --- internal/nsupdate/nsupdate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/nsupdate/nsupdate.go b/internal/nsupdate/nsupdate.go index a1c4b36..9451a16 100644 --- a/internal/nsupdate/nsupdate.go +++ b/internal/nsupdate/nsupdate.go @@ -51,7 +51,9 @@ func (c NsUpdateStruct) UpdateTXT(record, recordType, value string) error { return err } - oldTXT := stdout.String() + oldTXT := strings.TrimLeft(strings.TrimRight(stdout.String(), "\n\""), "\"") + config.Cfg.Log.Debug("existing record", "record", strings.ReplaceAll(oldTXT, `" "`, ``)) + config.Cfg.Log.Debug("new record", "record", strings.ReplaceAll(value, `" "`, ``)) if strings.ReplaceAll(oldTXT, `" "`, ``) != strings.ReplaceAll(value, `" "`, ``) { config.Cfg.Log.Debug("deleting record", "record", record)