root/alternc/tags/0.9.6.3/src/slave_dns
| Revision 1798, 1.9 kB (checked in by nahuel, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | #!/usr/bin/php -q |
| 2 | <?php |
| 3 | |
| 4 | /* |
| 5 | $Id: slave_dns,v 1.5 2004/11/25 17:20:55 anonymous Exp $ |
| 6 | ---------------------------------------------------------------------- |
| 7 | AlternC - Web Hosting System |
| 8 | Copyright (C) 2002 by the AlternC Development Team. |
| 9 | http://alternc.org/ |
| 10 | ---------------------------------------------------------------------- |
| 11 | Based on: |
| 12 | Valentin Lacambre's web hosting softwares: http://altern.org/ |
| 13 | ---------------------------------------------------------------------- |
| 14 | LICENSE |
| 15 | |
| 16 | This program is free software; you can redistribute it and/or |
| 17 | modify it under the terms of the GNU General Public License (GPL) |
| 18 | as published by the Free Software Foundation; either version 2 |
| 19 | of the License, or (at your option) any later version. |
| 20 | |
| 21 | This program is distributed in the hope that it will be useful, |
| 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | GNU General Public License for more details. |
| 25 | |
| 26 | To read the license please visit http://www.gnu.org/copyleft/gpl.html |
| 27 | ---------------------------------------------------------------------- |
| 28 | Original Author of file: Benjamin Sonntag |
| 29 | Purpose of file: Manage allowed slave dns ip addresses / classes |
| 30 | ---------------------------------------------------------------------- |
| 31 | |
| 32 | */ |
| 33 | |
| 34 | $FLAGFILE="/var/run/alternc/refresh_slave"; |
| 35 | |
| 36 | if (file_exists($FLAGFILE)) { |
| 37 | unlink($FLAGFILE); |
| 38 | include("/var/alternc/bureau/class/local.php"); |
| 39 | mysql_connect($L_MYSQL_HOST,$L_MYSQL_LOGIN,$L_MYSQL_PWD); |
| 40 | mysql_select_db($L_MYSQL_DATABASE); |
| 41 | $r=mysql_query("SELECT * FROM slaveip"); |
| 42 | $f=fopen("/var/alternc/bind/slaveip.conf","wb"); |
| 43 | fputs($f," |
| 44 | // DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN |
| 45 | // Use the AlternC managment console instead. |
| 46 | acl \"allslaves\" { |
| 47 | { |
| 48 | 127.0.0.1; // myself, just to be sure |
| 49 | "); |
| 50 | while ($c=mysql_fetch_array($r)) { |
| 51 | fputs($f,$c['ip']."/".$c['class'].";\n"); |
| 52 | } |
| 53 | fputs($f,"};\n};\n"); |
| 54 | fclose($f); |
| 55 | exec("invoke-rc.d bind9 reload"); |
| 56 | } |
| 57 | |
| 58 |
Note: See TracBrowser for help on using the browser.
