root/alternc/branches/larpoux-unstable/src/slave_dns

Revision 724, 1.9 kB (checked in by anarcat, 3 years ago)

[project @ Big work on BIND interaction]
Big work on BIND interaction


Big work on BIND interaction :

  • do_domaines.sh was mostly rewritten, and is now named update_domains.sh
  • templates used to build automatic.conf and zone files are now in
    /etc/bind/templates once installed
  • automatic.conf and slaveip.conf are now generated in /var/alternc/bind
  • zone fils are now generated in /var/alternc/bind/zones.
  • Renames :

/etc/bind/domaines.template -> /etc/bind/templates/named.template
/etc/bind/master/domaines.template -> /etc/bind/templates/zone.template * Gone (unused) :
/etc/bind/master/mx.template
/etc/bind/master/slave.template
/etc/bind/master

  • The Debian preinst script take cares of moving updating file locations

ONETIME_FILES was removed from alternc.install :

  • postfix's header_checks and body_checks are copied only once by
    alternc.install, and have been move from /etc/alternc/templates
    (there was no macro expansion anyway)
  • /var/alternc/bind/automatic.conf is now generated empty if it doesn't
    exists
  • /var/alternc/bind/slaveip.conf is now generated by alternc.install
    calling the slave_dns script.

Other fixes in alternc.install :

  • The tar used to check for installed files modifications now redirect
    errors to /dev/null
  • Reorganized to group small things together

Original author: lunar@anargeek.net
Date: 2005-09-06 18:57:06

Line 
1 #!/usr/bin/php4 -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("/etc/init.d/bind9 reload");
56 }
57
58
Note: See TracBrowser for help on using the browser.