diff options
author | Luke Bratch <luke@bratch.co.uk> | 2017-04-12 22:15:28 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2017-04-12 22:15:28 +0100 |
commit | b1b695e355343a2c5d1b34922a36f58f062b3b51 (patch) | |
tree | acc8d5cdee91cc414bbecdb656eb26260a37efd6 | |
parent | 837cfa1cc437dd7a618237426f198c635f500b01 (diff) |
Attempt two of moving those configuration variables, this time using constants
-rw-r--r-- | dns.php | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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"); } |