From dcf87bab819740f263f6024ac75e9d0c09967376 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 3 Apr 2019 10:30:50 +0200 Subject: ddns-status.php: give more helpful error messages --- ddns-status.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ddns-status.php b/ddns-status.php index 5c42ca7..2e7c38a 100644 --- a/ddns-status.php +++ b/ddns-status.php @@ -1,9 +1,17 @@ \n" . $extra_message . "\n"; + die(); +} + $pin = popen('dig @127.0.0.1 ddns.eckner.net AXFR', 'r'); if (!$pin) - die(); + die_http(500, 'Internal Server Error', 'Failed to get Zone.'); $found = false; $axfr = array(); @@ -30,7 +38,7 @@ while (($line = fgets($pin)) !== false) { pclose($pin); if (! $found) - die(); + die_http(403, 'Forbidden', 'You are not known to ddns.'); $hosts = explode( "\n", -- cgit v1.2.3-54-g00ecf