jablonka.czprosek.czf

hotsanic

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

Compare with Previous - Blame - Download


#!/usr/bin/env perl

# $Id: setup.pl,v 1.8 2004/07/12 07:50:14 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.8 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: setup.pl,v 1.8 2004/07/12 07:50:14 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{NETWORK}}) { $MODCONF{NETWORK}="NETWORK=\"".join("\"\nNETWORK=\"",@{$MODCONF{NETWORK}})."\""; }
else { $MODCONF{NETWORK}="NETWORK=\"other:*\"\nNETWORK=\"local:127.0.0.\""; }

print OUTFILE "# SHORT DESCRIPTION
#
# first of all you have to configure the pathes to the dnet logfiles
#
# Example:
#
# LOGPATH=/var/log/rc5
# LOGNAME_RC5=pproxyrc5
# LOGNAME_DES=pproxydes
# LOGNAME_CSC=pproxycsc
# LOGNAME_OGR=pproxyogr
#
LOGPATH=\"$MODCONF{LOGPATH}\"
LOGNAME_RC5=\"$MODCONF{LOGNAME_RC5}\"
LOGNAME_DES=\"$MODCONF{LOGNAME_DES}\"
LOGNAME_CSC=\"$MODCONF{LOGNAME_CSC}\"
LOGNAME_OGR=\"$MODCONF{LOGNAME_OGR}\"

# Then you may define one or more networks or hosts to be shown separately
#
#
# NETWORK=<name>:<network1>,<network2>, ...
#
# each network may be a single host or a network
# each network has to be terminated by a dot.
#
# ATTENTION! \"network\" means a network-address with the last 
# part cleared out ... well let me give you a hint:
# 192.168.1.    would be 192.168.1.0/24
# 192.168.      would be 192.168.0.0/16
#
# sorry, but my module does not yet understand netmasks :(
# but i intend to edit the whole thing some day when time is my friend again...
#
# Example:
#
# NETWORK=other:*
# NETWORK=unknown_local:192.168.1.
# NETWORK=host1:192.168.1.1.
# NETWORK=host2:192.168.1.20.
# NETWORK=some_hosts:192.168.1.30.,192.168.1.31.,192.168.1.32.
#
$MODCONF{NETWORK}
";

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