X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=perl%2Fclient.pl;h=b8129cbb384cd0d7c8d8ea7872460586b9e3f627;hp=834aaf37ce2e33a019987e1ad2b4fe0d8fc1c653;hb=6a0068ec3df1dca0c6ae2714af3c0a4a62998dcf;hpb=3f145290a93b39bf15b50269dd8be585d7b4bc9c diff --git a/perl/client.pl b/perl/client.pl index 834aaf37..b8129cbb 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -59,6 +59,8 @@ sub cease if (defined $conn && $sendz) { $conn->send_now("Z$call|bye...\n"); } + STDOUT->flush; + sleep(2); exit(0); } @@ -201,6 +203,20 @@ $SIG{'HUP'} = \&sig_term; $SIG{'CHLD'} = \&sig_chld; $conn = Msg->connect("$clusteraddr", $clusterport, \&rec_socket); +if (! $conn) { + if (-r "$data/offline") { + open IN, "$data/offline" or die; + while () { + s/\n/\r/og if $mode == 1; + print; + } + close IN; + } else { + print "Sorry, the cluster $mycall is currently off-line", $mynl; + } + cease(0); +} + $conn->send_now("A$call|$connsort"); Msg->set_event_handler(\*STDIN, "read" => \&rec_stdin);