version 1.294, 2005/08/31 21:47:29
|
version 1.296, 2005/09/01 07:49:43
|
Line 1370 sub du_handler {
|
Line 1370 sub du_handler {
|
if ($_=~/\.meta$/) { return;} |
if ($_=~/\.meta$/) { return;} |
$total_size+=(stat($_))[7]; |
$total_size+=(stat($_))[7]; |
}; |
}; |
chdir($ududur); |
chdir($ududir); |
find($code,$ududir); |
find($code,$ududir); |
$total_size=int($total_size/1024); |
$total_size=int($total_size/1024); |
&Reply($client,"$total_size\n","$cmd:$ududir"); |
&Reply($client,"$total_size\n","$cmd:$ududir"); |
Line 4405 sub ReadHostTable {
|
Line 4405 sub ReadHostTable {
|
open (CONFIG,"$perlvar{'lonTabDir'}/hosts.tab") || die "Can't read host file"; |
open (CONFIG,"$perlvar{'lonTabDir'}/hosts.tab") || die "Can't read host file"; |
my $myloncapaname = $perlvar{'lonHostID'}; |
my $myloncapaname = $perlvar{'lonHostID'}; |
Debug("My loncapa name is : $myloncapaname"); |
Debug("My loncapa name is : $myloncapaname"); |
|
my %name_to_ip; |
while (my $configline=<CONFIG>) { |
while (my $configline=<CONFIG>) { |
if ($configline !~ /^\s*\#/ && $configline !~ /^\s*$/ ) { |
if ($configline !~ /^\s*\#/ && $configline !~ /^\s*$/ ) { |
my ($id,$domain,$role,$name)=split(/:/,$configline); |
my ($id,$domain,$role,$name)=split(/:/,$configline); |
$name=~s/\s//g; |
$name=~s/\s//g; |
my $ip = gethostbyname($name); |
my $ip; |
if (length($ip) ne 4) { |
if (!exists($name_to_ip{$name})) { |
&logthis("Skipping host $id name $name no IP $ip found\n"); |
$ip = gethostbyname($name); |
next; |
if (!$ip || length($ip) ne 4) { |
|
&logthis("Skipping host $id name $name no IP found\n"); |
|
next; |
|
} |
|
$ip=inet_ntoa($ip); |
|
$name_to_ip{$name} = $ip; |
|
} else { |
|
$ip = $name_to_ip{$name}; |
} |
} |
$ip=inet_ntoa($ip); |
|
$hostid{$ip}=$id; # LonCAPA name of host by IP. |
$hostid{$ip}=$id; # LonCAPA name of host by IP. |
$hostdom{$id}=$domain; # LonCAPA domain name of host. |
$hostdom{$id}=$domain; # LonCAPA domain name of host. |
$hostip{$id}=$ip; # IP address of host. |
$hostip{$id}=$ip; # IP address of host. |