Skip to content

Commit 3e2544d

Browse files
author
A. Täffner
committed
Zone-Checking improved
Implements a colored background if bind fails to load the zone due to errors Implements a status text if errors occured Implements not removing a zone if errors occur. instead old zone stays loaded
1 parent dd1d83c commit 3e2544d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

server/plugins-available/bind_plugin.inc.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,13 @@ function soa_update($event_name, $data) {
273273
//* Check the zonefile
274274
if(is_file($filename.'.err')) unlink($filename.'.err');
275275
$out=array();
276-
exec('named-checkzone '.escapeshellarg($zone['origin']).' '.escapeshellarg($filename.'.pending').' 2>&1', $out, $return_status);
276+
exec('named-checkzone '.escapeshellarg($zone['origin']).' '.escapeshellarg($filename).' 2>&1', $out, $return_status);
277277
$statustext='';
278278
foreach ($out as $line) $statustext .= $line."\n";
279279
if($return_status === 0) {
280280
$app->log("Writing BIND domain file: ".$filename, LOGLEVEL_DEBUG);
281281
$app->db->query('UPDATE dns_soa SET status=\'OK\', status_txt=\'\' WHERE id='.$data['new']['id']);
282282
$app->dbmaster->query('UPDATE dns_soa SET status=\'OK\', status_txt=\'\' WHERE id='.$data['new']['id']);
283-
284283
} else {
285284
$loglevel = @($dns_config['disable_bind_log'] === 'y')?'LOGLEVEL_DEBUG':'LOGLEVEL_WARN';
286285
$app->log("Writing BIND domain file failed: ".$filename." ".implode(' ', $out), $loglevel);
@@ -340,7 +339,6 @@ function soa_update($event_name, $data) {
340339

341340
if(is_file($filename)) unlink($filename);
342341
if(is_file($filename.'.err')) unlink($filename.'.err');
343-
if(is_file($filename.'.pending')) unlink($filename.'.pending');
344342
if(is_file($filename.'.signed')) unlink($filename.'.signed');
345343
}
346344

0 commit comments

Comments
 (0)