lib/update.operations: update_domain_forward/reverse: use --add-origin, unless hosts name does not include a . dns-new
authorTero Marttila <terom@paivola.fi>
Thu, 19 Dec 2013 20:47:43 +0200
branchdns-new
changeset 92 639a5093039b
parent 91 acb2fb235eb2
child 93 1a313b7b6d40
lib/update.operations: update_domain_forward/reverse: use --add-origin, unless hosts name does not include a .
lib/update.operations
--- a/lib/update.operations	Thu Dec 19 18:55:53 2013 +0200
+++ b/lib/update.operations	Thu Dec 19 20:47:43 2013 +0200
@@ -59,12 +59,19 @@
     local domain="$1"; shift
     local src="$1"; shift
 
+    local origin_opts=
+
+    if [[ "$domain" == *.* ]]; then
+        origin_opts="--add-origin"
+    fi
+
     if check_update "$out" "$src" "$@"; then
         log_update "Generating forward hosts zone $out <- $src..."
     
         do_update "$out" $OPT/bin/pvl.hosts-dns \
             --hosts-charset=$CHARSET \
             --forward-zone="$domain" \
+            $origin_opts \
              "$src" "$@"
     
     else
@@ -101,6 +108,7 @@
         do_update "$out" $OPT/bin/pvl.hosts-dns \
             --hosts-charset=$CHARSET \
             --reverse-zone="$reverse" \
+            --add-origin \
             "$src" "$@"
     
     else