diff -r 5a83f2abc0dd -r 77df429f63a3 lib/update.operations --- a/lib/update.operations Tue Dec 17 00:26:44 2013 +0200 +++ b/lib/update.operations Tue Dec 17 01:17:49 2013 +0200 @@ -70,36 +70,61 @@ ## Generate forward zone from hosts hosts using pvl.hosts-dns: # -# update_hosts out/hosts/$hosts in/hosts/$hosts +# update_hosts_forward out/hosts/$hosts $hosts in/hosts/$hosts function update_hosts_forward { - local out=$1 - local src=$2 + local out=$1; shift + local domain=$1; shift + local src=$1; shift - if check_update $out $src; then - log_update "Generating hosts zone $out <- $src..." + if check_update $out $src "$@"; then + log_update "Generating forward hosts zone $out <- $src..." - do_update $out $OPT/bin/pvl.hosts-dns $src \ - --hosts-charset=$CHARSET + do_update $out $OPT/bin/pvl.hosts-dns \ + --hosts-charset=$CHARSET \ + --forward-zone=$domain \ + $src "$@" else - log_skip "Generating hosts $out <- $src: not changed" + log_skip "Generating forward hosts $out <- $src: not changed" fi } function update_hosts_dhcp { - local out=$1 - local src=$2 + local out=$1; shift + local src=$1; shift - if check_update $out $src; then + if check_update $out $src "$@"; then log_update "Generating DHCP hosts $out <- $src..." - do_update $out $OPT/bin/pvl.hosts-dhcp $src \ - --hosts-charset=$CHARSET + do_update $out $OPT/bin/pvl.hosts-dhcp \ + --hosts-charset=$CHARSET \ + $src "$@" else log_skip "Generating DHCP hosts $out <- $src: not changed" fi } +## Generate reverse zone from hosts hosts using pvl.hosts-dns: +# +# update_hosts_reverse out/hosts/$reverse $reverse in/hosts/$hosts +function update_hosts_reverse { + local out=$1; shift + local reverse=$1; shift + local src=$1; shift + + if check_update $out $src "$@"; then + log_update "Generating reverse hosts zone $out <- $src..." + + do_update $out $OPT/bin/pvl.hosts-dns \ + --hosts-charset=$CHARSET \ + --reverse-zone=$reverse \ + $src "$@" + + else + log_skip "Generating reverse hosts $out <- $src: not changed" + fi +} + ## Update .serial number: # # do_update_serial $serial