
#
# Check for correct password.
#

$JOB    = $ARGV[0];
$PASSWORD = $ARGV[1];

$DIR = "$ENV{SERVER_VAR}/jobs/job.$JOB";

if (-d "$DIR") {
  if (-s "$DIR/job.password") {
    $PASS = `cat $DIR/job.password`;
    $PASS =~ s/\n//;
    unless ($PASSWORD eq $PASS) {
      exit 1;
    }
  }
}
