#!/usr/bin/perl
-# $Header: scanner,v 2.0 88/06/05 00:17:42 root Exp $
+# $RCSfile: scanner,v $$Revision: 4.1 $$Date: 92/08/07 17:20:44 $
# This runs all the scan_* routines on all the machines in /etc/ghosts.
# We run this every morning at about 6 am:
print "Subject: bizarre happenings\n\n";
-(chdir '/usr/adm/private') || die "Can't cd.";
+(chdir '/usr/adm/private') || die "Can't cd to /usr/adm/private: $!\n";
if ($#ARGV >= 0) {
@scanlist = @ARGV;
$iter = 0;
`exec crypt -inquire <$scan >.x 2>/dev/null`;
unless (open(scan,'.x')) {
- print "Can't run $scan.";
+ print "Can't run $scan: $!\n";
next scan;
}
$cmd = <scan>;
$cmd = '/usr/bin/perl';
}
close(scan);
- if (open(pipe,"exec rsh $host '$cmd' <.x|")) {
+ if (open(PIPE,"exec rsh $host '$cmd' <.x|")) {
sleep(5);
unlink '.x';
- while (<pipe>) {
+ while (<PIPE>) {
last if $iter++ > 1000; # must be looping
next if /^[0-9.]+u [0-9.]+s/;
print $showhost,$_;
}
- close(pipe);
+ close(PIPE);
} else {
- print "(Can't execute rsh.)\n";
+ print "(Can't execute rsh: $!)\n";
}
last class;
}