diff options
-rw-r--r-- | dns.php | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -119,7 +119,14 @@ function writezone($domain, $zonetext, $password = null) { } // Reload the zone if we got this far - sshrun("echo -en \"$zonetext\" > " . ZONEROOT . "$domain" . ZONESUFFIX); + $zonewrite = sshrun("echo -en \"$zonetext\" > " . ZONEROOT . "$domain" . ZONESUFFIX . " && echo $? || echo $?"); + + // If the return code was non-zero then fail + if ($zonewrite[sizeof($zonewrite) - 1] != "0") { + echo "<p>error: something went wrong when writing the zone file, please ask someone for help</p>"; + die(); + } + sshrun("rndc reload $domain"); } |