From a6d744a2d487956631bf3e189aa136c5789a1be0 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Fri, 15 Dec 2000 21:13:14 +0000 Subject: [PATCH] added code to keep saem group name order as in spong.host file in @GROUPS_LIST var --- src/spong-server.pl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/spong-server.pl b/src/spong-server.pl index 618b591..c513e68 100755 --- a/src/spong-server.pl +++ b/src/spong-server.pl @@ -6,7 +6,7 @@ # There are one or more update processes that listen for status updates # from client programs. -# $Id: spong-server.pl,v 1.31 2000/11/29 21:01:38 sljohnson Exp $ +# $Id: spong-server.pl,v 1.32 2000/12/15 21:13:14 sljohnson Exp $ use lib "@@LIBDIR@@"; @@ -1197,9 +1197,21 @@ sub load_config_files { if( sort @HOSTS_LIST != sort keys %HOSTS ) { @HOSTS_LIST = sort keys %HOSTS; } - # Read in the group file + # Do the same thing for the groups file. - require $groups_file if -f $groups_file; + $evalme = ""; + open( GROUPS, $groups_file ) || die "Can't load $groups_file: $!"; + while( ) { + $evalme .= $_; + if( /^\s*%GROUPS\s*=\s*\(/ ) { $ingroups = 1; } + if( $ingroups && /^\s*[\'\"]?([^\s\'\"]+)[\'\"]?\s*\=\>\s*\{/ ) { + push( @GROUPS_LIST, $1 ); } + } + close( GROUPS ); + eval $evalme || die "Invalid spong.groups file: $@"; + + if( sort @GROUPS_LIST != sort keys %GROUPS ) { + @GROUPS_LIST = sort keys %GROUPS; } } -- 2.30.2