#!/opt/bin/perl

# Print out a content-type for HTTP/1.0 compatibility
# print "Content-type: text/html\n\n";
print "Pragma: no-cache\n";

# Get the input
$userid = $ENV{'QUERY_STRING'};
#$fname = system 'ypmatch',$userid,'passwd','|','cut','-d:','-f6';
chop($fname = `ypmatch $userid passwd|cut -d: -f6`);
$fname1 = $fname."/public_html/index.html";
$fname2 = $fname."/public_html/index.htm";
if ( -e $fname1 || -e $fname2 ) {
   print "Location: http://www.auburn.edu/~$userid","\n\n";
} else {
   print "Location: http://www.auburn.edu/main/nohome.html","\n\n";
}
