#!/afs/athena/contrib/perl/perl

$time = 768517200 - $^T;

### time calculation

$tt = int(($time/60)+.5);
exit 0 if ($tt < 0);
$m = $tt % 60;
$h = ($tt-$m) / 60;

### message

if ($tt > 0) {
    $time = "$h hours, $m minutes";
    $msg = "@helvetica[$time left till the end of Junior Lab]";
} else {
    $time = "*** OVER ***";
    $msg = "@helvetica[@huge[THIS IS THE END...  congratulations!]]";
}


### parameters

$zwrite = '/usr/athena/bin/zwrite';
$zsig =   '8.14 Countdown Server';

($class,$instance) = ('message','junior-lab');

@opts = ('-d', '-q', '-c', $class, '-i', $instance, '-s', $zsig, '-m', $msg);

### call...

exec ($zwrite,@opts);
