jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [bind/] [setup.pl] - Rev 16 Go to most recent revision

Compare with Previous - Blame - Download


#!/usr/bin/env perl

# $Id: setup.pl,v 1.9 2004/07/12 07:50:13 bernisys Exp $

# include PERL libraries
use strict;
use warnings;
use diagnostics;

# include HotSaNIC libraries
use lib "../../lib";
use lib "./platform";
use HotSaNICparser;
use HotSaNICshellio;
use HotSaNIClog;
use common;

$|=1;

(my $VERSION = '$Revision: 1.9 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: setup.pl,v 1.9 2004/07/12 07:50:13 bernisys Exp $') =~ s/.*,v (.*) \$/$1/;

my $MODNAME=HotSaNICparser::get_module_name();
my %MODCONF=HotSaNICmod::common::configure();
my $OUTFILE="settings.new";
if ( ! -e "settings" ) { $OUTFILE="settings"; }
open OUTFILE,">$OUTFILE" || die "could not open ".HotSaNICparser::get_module_name()." settings file for writing.\n";

if ($MODCONF{BINDPATH} eq "") {
  my @found=HotSaNICparser::locate_files("bin/rndc");
  $MODCONF{BINDPATH}=HotSaNICshellio::choose("","\"rndc\" could not be found.",@found);
  }

print OUTFILE "# SHORT DESCRIPTION
#
# You need to enter the path to your (r)ndc binary and
# the filename which BIND logs statistics to.
#
# Extra BIND configuration should not be necessary, however
# BIND should NOT be automatically generating statistics
# (use the 'statisticsinterval 0' option in named.conf) since
# this module will be doing it anyhow.
#
# Example:
#   BINDPATH=/usr/local/bin/rndc
#   BINDSTAT=/var/named/named.stats
#
BINDPATH=$MODCONF{BINDPATH}
BINDSTAT=$MODCONF{BINDSTAT}
";

close OUTFILE;

if ($OUTFILE eq "settings.new") {
  HotSaNICparser::backup_file("settings");
  rename "settings.new","settings";
  }

print "Please check the settings file and adapt it to satisfy your needs.\n";


Powered by WebSVN 2.2.1