From 04dd40d98617a67de54f661482f2955acc4a1d52 Mon Sep 17 00:00:00 2001 From: Chip Black Date: Mon, 18 Aug 2008 02:08:27 -0500 Subject: [PATCH] Added high-level check spawning daemon, removed .pl suffixes --- runcheckdir.pl => runcheckdir | 0 runchecks | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) rename runcheckdir.pl => runcheckdir (100%) create mode 100755 runchecks 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); +} -- 2.25.1