--- loncom/loncron 2002/06/08 14:59:04 1.30 +++ loncom/loncron 2002/07/25 18:24:27 1.31 @@ -93,14 +93,21 @@ if ($wwwid!=$<) { my $config=IO::File->new("$perlvar{'lonTabDir'}/hosts.tab"); while (my $configline=<$config>) { - my ($id,$domain,$role,$name,$ip)=split(/:/,$configline); - $hostname{$id}=$name; - $hostdom{$id}=$domain; - $hostrole{$id}=$role; - $hostip{$id}=$ip; - if (($role eq 'library') && ($id ne $perlvar{'lonHostID'})) { - $libserv{$id}=$name; - } + my ($id,$domain,$role,$name,$ip,$domdescr)=split(/:/,$configline); + if ($id && $domain && $role && $name && $ip) { + $hostname{$id}=$name; + $hostdom{$id}=$domain; + $hostip{$id}=$ip; + $hostrole{$id}=$role; + if ($domdescr) { $domaindescription{$domain}=$domdescr; } + if (($role eq 'library') && ($id ne $perlvar{'lonHostID'})) { + $libserv{$id}=$name; + } + } else { + if ($configline) { +# &logthis("Skipping hosts.tab line -$configline-"); + } + } } } @@ -160,17 +167,17 @@ print $fh (< ENDHEADERS -foreach $varname (keys %perlvar) { +foreach $varname (sort(keys(%perlvar))) { print $fh "$varname$perlvar{$varname}\n"; } print $fh "

Hosts

"; -foreach $id (keys %hostname) { -print $fh - ""; -print $fh "\n"; +foreach $id (sort(keys(%hostname))) { + print $fh + ""; + print $fh "\n"; } print $fh "
$id$hostdom{$id}$hostrole{$id}$hostname{$id}$hostip{$id}
$id$hostdom{$id}$hostrole{$id}$hostname{$id}$hostip{$id}

Spare Hosts

    "; -foreach $id (keys %spareid) { +foreach $id (sort(keys(%spareid))) { print $fh "
  1. $id\n"; } @@ -643,7 +650,7 @@ print $fh ""; print $fh '

    Connections

    '; print $fh ""; -foreach $tryserver (keys %hostname) { +foreach $tryserver (sort(keys(%hostname))) { $answer=reply("pong",$tryserver); if ($answer eq "$tryserver:$perlvar{'lonHostID'}") {