
#
# Verify the password
#

unless (-s "PASSWORD") {
  print "Password missing.\n"; 
  exit 1;
} 

$_ = `cat PASSWORD`;
s/\s*$//;

$MAX = 20;

if (/\s/) {
  print "password \"$_\" cannot contain any white space.\n";
  exit 1;
}

if (length($_) > $MAX) {
  print "password must be less than $MAX characters.\n";
  exit 1;
}

system("echo $_ >PASSWORD");
