From 17742cfad3ce2e4d0f59f7eb1993792fbcd04da7 Mon Sep 17 00:00:00 2001
From: Olaf Bohlen <olbohlen@eenfach.de>
Date: Thu, 23 Apr 2020 15:24:55 +0200
Subject: [PATCH] simple and dirty approach

---
 eenfach-iv.ksh |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/eenfach-iv.ksh b/eenfach-iv.ksh
index b826a9d..aba1736 100755
--- a/eenfach-iv.ksh
+++ b/eenfach-iv.ksh
@@ -2,6 +2,13 @@
 # olbohlen, 2020-04-17 in corona seperation...
 # for my personal setup build a dynamic inventory of all ldoms and zones
 
+# --list is default action
+# fake --host operation by printing an empty dictionary
+if [ "x$1" == "x--host" ]; then
+    printf "{}\n"
+    exit 0
+fi  
+
 domain=eenfach.de
 primary="prigw-vsw"
 
@@ -34,7 +41,7 @@
 # print ldoms group
 printf "\"eenfachldoms\": {\n\"hosts\": ["
 for ldom in ${ldoms}; do
-    printf "%s\n\"%s\"" "${comma}" "${ldom}"
+    printf "%s\n\"%s.%s\"" "${comma}" "${ldom}" "${domain}"
     comma=","
 done
 comma=""

--
Gitblit v1.9.3