jablonka.czprosek.czf

hotsanic

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

Compare with Previous - Blame - Download


#!/usr/bin/env perl

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

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

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

use HotSaNIClog;
use common;

$|=1;

(my $VERSION = '$Revision: 1.6 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: setup.pl,v 1.6 2004/07/12 07:50:16 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{ITEM}}) { $MODCONF{ITEM}="ITEM=\"".join("\"\nITEM=\"",@{$MODCONF{ITEM}})."\""; }
else { $MODCONF{ITEM}=""; }

print OUTFILE "# SHORT DESCRIPTION
# full path to the httpd logfile directory
#   LOGPATH=\"/var/log/httpd\"
#
LOGPATH=\"$MODCONF{LOGPATH}\"

# name of the httpd access logfiles
#   LOGNAME=\"access_log\"
#
LOGNAME=\"$MODCONF{LOGNAME}\"

# query-time in seconds
#   INTERVAL=600
#
INTERVAL=\"$MODCONF{INTERVAL}\"

# list items to query from HTTPD logfile
#   ITEM=<string>:<description>
#
$MODCONF{ITEM}
";

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