68 copy $out $src |
68 copy $out $src |
69 } |
69 } |
70 |
70 |
71 ## Generate forward zone from hosts hosts using pvl.hosts-dns: |
71 ## Generate forward zone from hosts hosts using pvl.hosts-dns: |
72 # |
72 # |
73 # update_hosts out/hosts/$hosts in/hosts/$hosts |
73 # update_hosts_forward out/hosts/$hosts $hosts in/hosts/$hosts |
74 function update_hosts_forward { |
74 function update_hosts_forward { |
75 local out=$1 |
75 local out=$1; shift |
76 local src=$2 |
76 local domain=$1; shift |
77 |
77 local src=$1; shift |
78 if check_update $out $src; then |
78 |
79 log_update "Generating hosts zone $out <- $src..." |
79 if check_update $out $src "$@"; then |
80 |
80 log_update "Generating forward hosts zone $out <- $src..." |
81 do_update $out $OPT/bin/pvl.hosts-dns $src \ |
81 |
82 --hosts-charset=$CHARSET |
82 do_update $out $OPT/bin/pvl.hosts-dns \ |
83 |
83 --hosts-charset=$CHARSET \ |
84 else |
84 --forward-zone=$domain \ |
85 log_skip "Generating hosts $out <- $src: not changed" |
85 $src "$@" |
|
86 |
|
87 else |
|
88 log_skip "Generating forward hosts $out <- $src: not changed" |
86 fi |
89 fi |
87 } |
90 } |
88 |
91 |
89 function update_hosts_dhcp { |
92 function update_hosts_dhcp { |
90 local out=$1 |
93 local out=$1; shift |
91 local src=$2 |
94 local src=$1; shift |
92 |
95 |
93 if check_update $out $src; then |
96 if check_update $out $src "$@"; then |
94 log_update "Generating DHCP hosts $out <- $src..." |
97 log_update "Generating DHCP hosts $out <- $src..." |
95 |
98 |
96 do_update $out $OPT/bin/pvl.hosts-dhcp $src \ |
99 do_update $out $OPT/bin/pvl.hosts-dhcp \ |
97 --hosts-charset=$CHARSET |
100 --hosts-charset=$CHARSET \ |
|
101 $src "$@" |
98 else |
102 else |
99 log_skip "Generating DHCP hosts $out <- $src: not changed" |
103 log_skip "Generating DHCP hosts $out <- $src: not changed" |
|
104 fi |
|
105 } |
|
106 |
|
107 ## Generate reverse zone from hosts hosts using pvl.hosts-dns: |
|
108 # |
|
109 # update_hosts_reverse out/hosts/$reverse $reverse in/hosts/$hosts |
|
110 function update_hosts_reverse { |
|
111 local out=$1; shift |
|
112 local reverse=$1; shift |
|
113 local src=$1; shift |
|
114 |
|
115 if check_update $out $src "$@"; then |
|
116 log_update "Generating reverse hosts zone $out <- $src..." |
|
117 |
|
118 do_update $out $OPT/bin/pvl.hosts-dns \ |
|
119 --hosts-charset=$CHARSET \ |
|
120 --reverse-zone=$reverse \ |
|
121 $src "$@" |
|
122 |
|
123 else |
|
124 log_skip "Generating reverse hosts $out <- $src: not changed" |
100 fi |
125 fi |
101 } |
126 } |
102 |
127 |
103 ## Update .serial number: |
128 ## Update .serial number: |
104 # |
129 # |