fix last commit
authorStricted <info@stricted.de>
Wed, 3 Jun 2015 11:31:02 +0000 (13:31 +0200)
committerStricted <info@stricted.de>
Wed, 3 Jun 2015 11:31:02 +0000 (13:31 +0200)
bind9.php

index 89d15a586e6b1717fbd88e55d8d975713a01878e..d091f79236e91d4f57d5d69a27c36b5a01560add 100644 (file)
--- a/bind9.php
+++ b/bind9.php
@@ -35,7 +35,7 @@ if (is_array($data) && !isset($data['error'])) {
                        else if ($record['type'] == "MX" || $record['type'] == "SRV" || $record['type'] == "TLSA" || $record['type'] == "DS") {
                                $out .= $record['name']."\t".$record['ttl']."\tIN\t".$record['type']."\t".$record['aux']."\t".$record['data']."\n";
                        }
-                       elseif ($record['type'] == "TXT") {
+                       else if ($record['type'] == "TXT") {
                                $txt = $record['data'];
                                
                                if (strpos($txt, " ") !== false) {
@@ -114,8 +114,8 @@ if (is_array($data) && !isset($data['error'])) {
                        $sign = true;
                }
                
-               $handler = fOpen("/srv/bind/".$zone['soa']['origin']."db" , "a+");
-               fWrite($handler , $out);
+               $handler = fOpen("/srv/bind/".$zone['soa']['origin']."db", "a+");
+               fWrite($handler, $out);
                fClose($handler);
                
                $signed = false;
@@ -132,15 +132,11 @@ if (is_array($data) && !isset($data['error'])) {
                $cout .= "\tfile \"/srv/bind/".$zone['soa']['origin']."db".($signed === true ? ".signed" : "")."\";\n";
                $cout .= "};\n\n";
 
-               $handler = fOpen("/srv/bind/domains.cfg" , "a+");
-               fWrite($handler , $cout);
+               $handler = fOpen("/srv/bind/domains.cfg", "a+");
+               fWrite($handler, $cout);
                fClose($handler);
-
-               
-               if ($signed === true) {
-                       shell_exec("cd /srv/bind/ && /usr/sbin/dnssec-signzone -r /dev/urandom -A -N INCREMENT -K /srv/bind/dnssec/".$zone['soa']['origin']."/ -o ".$zone['soa']['origin']." -t ".$zone['soa']['origin']."db");
-               }
        }
+       
        shell_exec("/etc/init.d/bind9 reload");
 }