From: Chip Black Date: Mon, 18 Aug 2008 07:08:27 +0000 (-0500) Subject: Added high-level check spawning daemon, removed .pl suffixes X-Git-Url: http://git.bytex64.net/?a=commitdiff_plain;ds=sidebyside;h=04dd40d98617a67de54f661482f2955acc4a1d52;hp=fbac109aff440f2ecc8a4bc995ab2e2d3d4d675b;p=chksht.git Added high-level check spawning daemon, removed .pl suffixes --- diff --git a/runcheckdir.pl b/runcheckdir similarity index 100% rename from runcheckdir.pl rename to runcheckdir diff --git a/runchecks b/runchecks new file mode 100755 index 0000000..3467c28 --- /dev/null +++ b/runchecks @@ -0,0 +1,31 @@ +#!/usr/bin/perl +use strict; + +my $dir = shift; +unless (-d $dir) { + print "$dir is not a directory\n"; + exit 1; +} + +$|++; + +while (1) { + opendir(CHECKS, $dir); + while (my $d = readdir(CHECKS)) { + next if (! -d "$dir/$d" || $d eq '.' || $d eq '..'); + unless (-f "$dir/$d/check") { + print "No check script in $dir/$d\n"; + next; + } + print "Running check $dir/$d: "; + system("runcheckdir $dir/$d"); + my $exitstatus = $? >> 8; + if ($exitstatus) { + print "FAILURE\n"; + } else { + print "OK\n"; + } + sleep 10; + } + closedir(CHECKS); +}