From b1b695e355343a2c5d1b34922a36f58f062b3b51 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 12 Apr 2017 22:15:28 +0100 Subject: Attempt two of moving those configuration variables, this time using constants --- dns.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dns.php') diff --git a/dns.php b/dns.php index 71ad361..ddae571 100644 --- a/dns.php +++ b/dns.php @@ -3,8 +3,8 @@ ini_set("display_errors", 1); ini_set("display_startup_errors", 1); error_reporting(E_ALL); -$zoneroot = "/var/bind/pri/"; -$zonesuffix = ".zone"; +define("ZONEROOT", "/var/bind/pri/"); +define("ZONESUFFIX", ".zone"); function sshrun($command) { $host = "misc.tghost.co.uk"; @@ -27,7 +27,7 @@ function getzone($domain, $password) { die("invalid domain"); } - $string = sshrun("cat " . $zoneroot . $domain . $zonesuffix); + $string = sshrun("cat " . ZONEROOT . $domain . ZONESUFFIX); $zonelines = explode("\n", $string); $zonehash = explode(" ", $zonelines[0]); @@ -50,7 +50,7 @@ function writezone($domain, $password, $zonetext) { $zonetext = str_replace('$', '\$', $zonetext); - sshrun("echo -e \"$zonetext\" > $zoneroot$domain$zonesuffix"); + sshrun("echo -e \"$zonetext\" > " . ZONEROOT . "$domain" . ZONESUFFIX); sshrun("rndc reload $domain"); } -- cgit v1.2.3