knotcExec: abort transition on failure
This commit is contained in:
parent
e32d3bd1ed
commit
a6873d6ea6
1 changed files with 6 additions and 2 deletions
|
@ -8,12 +8,16 @@ function knotcExec($suffix, $cmd) {
|
|||
serverError("<code>knotc</code> failed with exit code <samp>" . $code['begin'] . "</samp>: <samp>" . $output['begin'][0] . "</samp>.");
|
||||
|
||||
exec(CONF['dns']['knotc_path'] . " zone-" . $action . "set " . $suffix . " " . implode(" ", $cmd), $output['op'], $code['op']);
|
||||
if ($code['op'] !== 0)
|
||||
if ($code['op'] !== 0) {
|
||||
exec(CONF['dns']['knotc_path'] . " zone-abort " . $suffix);
|
||||
serverError("<code>knotc</code> failed with exit code <samp>" . $code['op'] . "</samp>: <samp>" . $output['op'][0] . "</samp>.");
|
||||
}
|
||||
|
||||
exec(CONF['dns']['knotc_path'] . " zone-commit " . $suffix, $output['commit'], $code['commit']);
|
||||
if ($code['commit'] !== 0)
|
||||
if ($code['commit'] !== 0) {
|
||||
exec(CONF['dns']['knotc_path'] . " zone-abort " . $suffix);
|
||||
serverError("<code>knotc</code> failed with exit code <samp>" . $code['commit'] . "</samp>: <samp>" . $output['commit'][0] . "</samp>.");
|
||||
}
|
||||
}
|
||||
|
||||
function checkIpFormat($ip) {
|
||||
|
|
Loading…
Reference in a new issue