diff options
Diffstat (limited to 'dns.php')
| -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");  } | 
