4 // Rebuild the bind configuration's file
5 // with the IP of the slave dns
7 $FLAGFILE="/run/alternc/refresh_slave";
8 $TPL="/etc/alternc/templates/bind/slaveip.conf";
9 $TARGET="/var/lib/alternc/bind/slaveip.conf";
11 if (!file_exists($FLAGFILE)) exit(0);
14 require_once("/usr/share/alternc/panel/class/config_nochk.php");
16 $db->query("SELECT ip,class FROM slaveip;");
18 while ($db->next_record()) {
19 $str.=" ".$db->Record["ip"]."/".$db->Record["class"].";\n";
22 file_put_contents($TARGET, str_replace("//AUTO-SLAVES//",$str, file_get_contents($TPL) ) );
24 chown($TARGET,"root");
25 chgrp($TARGET,"bind");
28 putenv("PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin");
29 passthru("rndc reconfig");