head	1.3;
access;
symbols;
locks; strict;
comment	@# @;


1.3
date	2000.05.17.00.04.20;	author manoj;	state dead;
branches;
next	1.2;

1.2
date	2000.05.08.22.13.25;	author manoj;	state Exp;
branches;
next	1.1;

1.1
date	2000.04.29.00.04.10;	author jrobbins;	state Exp;
branches;
next	;


desc
@@


1.3
log
@DNS adds and deletes aren't necessary in the current structure, and we
can't rely on being able to change DNS when we change the vhost
structure either.
@
text
@#!/usr/bin/perl -w

# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#


# dns-project-add
# $Id: dns-project-add,v 1.2 2000/05/08 22:13:25 manoj Exp $
# --------------------
# Provide operations related to configuring DNS as part of tigris

use strict;

####################################################################
# We don't manage DNS; we assume bind is set up with a wildcard host
####################################################################
exit 0;


## Process arguments
#my $sandbox      = $ARGV[0];
#my $project_name       = $ARGV[1];
#my $domain_name        = $ARGV[2];
#my $brand_name         = $ARGV[3];
#
#my $host_ip = "63.211.145.5";
##TODO, get from somewhere, where?
#
#my $namedb_file = "$sandbox/db.tigris.org";
#my $namedb_out = "$sandbox/db.tigris.org.out";
##TODO: move to /etc/namedb
#
#
#my $new_serial = "                                        200003240       ; serial\n";
##TODO compute serial based on date and last serial, or just add one?
#
##TODO: add PID to prevent conflicts, actually that is not enough
#
#
#my $cmd = "unix command line";
#
#
#open(NAMEDB_IN, "<$namedb_file") || die "could not read namedb file: $namedb_file";
#
#open(NAMEDB_OUT, ">$namedb_out") || die "could not write namedb file: $namedb_out";
#
#
#while (<NAMEDB_IN>) {
#    if (/serial/) {
#	print NAMEDB_OUT $new_serial;
#    }
#    else {
#	print NAMEDB_OUT;
#    }
#}
#
## add the new host line
#print NAMEDB_OUT "$project_name IN A $host_ip\n";
#
#
#print "dns: add a line to /etc/namedb/db.tigris.org for: " . $project_name . "\n";
#print "     in domain " . $domain_name . "\n";
#
#
#
## HUP named
#
#$cmd = "kill -HUP `cat /var/run/named.pid`";
#print "Running: $cmd\n";
## use perl kill command?
#
#
@


1.2
log
@DNS should be managed with a wildcarded domain, so these scripts should
be unnecessary.
@
text
@d51 1
a51 1
# $Id: dns-project-add,v 1.1 2000/04/29 00:04:10 jrobbins Exp $
@


1.1
log
@initial checkin
@
text
@d51 1
a51 1
# $Id: dns.pm,v 1.1 2000/03/24 20:33:58 jrobbins Exp $
d57 59
a115 54

# Process arguments
my $sandbox      = $ARGV[0];
my $project_name       = $ARGV[1];
my $domain_name        = $ARGV[2];
my $brand_name         = $ARGV[3];

my $host_ip = "63.211.145.5";
#TODO, get from somewhere, where?

my $namedb_file = "$sandbox/db.tigris.org";
my $namedb_out = "$sandbox/db.tigris.org.out";
#TODO: move to /etc/namedb


my $new_serial = "                                        200003240       ; serial\n";
#TODO compute serial based on date and last serial, or just add one?

#TODO: add PID to prevent conflicts, actually that is not enough


my $cmd = "unix command line";


open(NAMEDB_IN, "<$namedb_file") || die "could not read namedb file: $namedb_file";

open(NAMEDB_OUT, ">$namedb_out") || die "could not write namedb file: $namedb_out";


while (<NAMEDB_IN>) {
    if (/serial/) {
	print NAMEDB_OUT $new_serial;
    }
    else {
	print NAMEDB_OUT;
    }
}

# add the new host line
print NAMEDB_OUT "$project_name IN A $host_ip\n";


print "dns: add a line to /etc/namedb/db.tigris.org for: " . $project_name . "\n";
print "     in domain " . $domain_name . "\n";



# HUP named

$cmd = "kill -HUP `cat /var/run/named.pid`";
print "Running: $cmd\n";
# use perl kill command?


@

