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


1.5
date	2001.08.08.01.38.14;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2001.08.08.01.32.12;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2001.08.01.02.14.49;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.08.01.02.12.31;	author dlr;	state Exp;
branches;
next	1.1;

1.1
date	2001.08.01.01.42.23;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Sometimes I really suck at Perl.
@
text
@#!/usr/bin/perl -w
# Creates Spread configuration.
# usage: spread_config <sandbox> <use standard ports> [ip list]

BEGIN
{
    my $SANDBOX = shift(@@ARGV);
    unshift(@@INC, "$SANDBOX/scripts");
}
use TigrisConfig;

my %PORTS = TigrisConfig::get_ports(shift(@@ARGV));
my @@IPS = scalar(@@ARGV) > 0 ? @@ARGV : ( '127.0.0.1' );
# ASSUMPTION: All daemons will be on the same network segment.  Deriving
# multicast segment from application server IP addresses for the time being.
my $segment = $IPS[0];
$segment =~ s/\.([0-9]+)$/.255/;

print << "EOT";
# Basic Spread daemon configuration
Spread_Segment $segment:$PORTS{SPREAD_PORT} {
EOT

my $hostNbr = 1;
for my $ip (@@IPS)
{
    print << "EOT";

    CH$hostNbr    $ip
EOT
    $hostNbr++;
}
print "}\n";
@


1.4
log
@Send the STANDARD_PORTS flag to the spread_config script to correctly generate the Spread daemon's port.
@
text
@d13 1
a13 1
my @@IPS = @@ARGV || ( '127.0.0.1' );
@


1.3
log
@Clarified usage and comment for $segment variable.
@
text
@d3 1
a3 1
# usage: spread_config <sandbox> [ip list]
@


1.2
log
@Generate the config in a more reasonable fashion.
@
text
@d3 1
a3 1
# usage: spread_config <sandbox> [segment] [ip list]
d14 2
a15 1
# ASSUMPTION: All daemons will be on the same network segment.
@


1.1
log
@First cut at Spread configuration generator.
@
text
@d3 1
a3 1
# usage: spread_config [host list]
d13 9
a21 2
my @@HOSTS = @@ARGV;
my $NBR_HOSTS = scalar(@@HOSTS);
d24 1
a24 1
for my $host (@@HOSTS)
a26 1
Spread_Segment $host:$PORTS{SPREAD_PORT} {
d28 1
a28 2
    CH$hostNbr    $host
}
d32 1
@

