summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dns.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/dns.php b/dns.php
index 6e560d9..85844b3 100644
--- a/dns.php
+++ b/dns.php
@@ -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");
}