moglia
2010-05-13 0110094b2d206e88dceb0cfe2bc4c85f2e826dda
server/mods-available/dns_module.inc.php
@@ -75,6 +75,10 @@
      $app->modules->registerTableHook('dns_soa',$this->module_name,'process');
      $app->modules->registerTableHook('dns_rr',$this->module_name,'process');
      
      // Register service
      $app->services->registerService('bind','dns_module','restartBind');
   }
   
   /*
@@ -99,6 +103,25 @@
      } // end switch
   } // end function
   
   function restartBind($action = 'restart') {
      global $app;
      $command = '';
      if(is_file('/etc/init.d/bind9')) {
         $command = '/etc/init.d/bind9';
      } else {
         $command = '/etc/init.d/named';
      }
      if($action == 'restart') {
         exec($command.' restart');
      } else {
         exec($command.' reload');
      }
   }
} // end class