This allows you to share the Spong config file between a bunch of
hosts using NFS (or other method), which can ease configuration.
Patch originally written by XeOn (pspa@isp.novis.pt) on Wed, Nov 22 2000
I've tidied it up a little bit.
# some junk to scan through the file so that we can maintain the order of
# the hosts as they appear in the file.
- open( HOSTS, $hosts_file ) || die "Can't load $hosts_file: $!";
+ # This is a little hack to allow the use of 'spong.hosts.hostname" (as in
+ # spong.conf.hostname.
+ my $hname = `hostname`;
+ chomp $hname;
+ if ( -f "$hosts_file.$hname" ) {
+ open( HOSTS, "$hosts_file.$hname" )
+ || die "Can't load $hosts_file.$hname: $!";
+ } else {
+ open( HOSTS, $hosts_file )
+ || die "Can't load $hosts_file: $!";
+ }
+
while( <HOSTS> ) {
$evalme .= $_;
if( /^\s*%HOSTS\s*=\s*\(/ ) { $inhosts = 1; }