From 3cbdf79c511129ad5a6856fffdaed230469d95eb Mon Sep 17 00:00:00 2001 From: Chip Black Date: Mon, 18 Aug 2008 02:13:17 -0500 Subject: [PATCH] Changed runcheckdir so that failure and success only trigger once per change --- runcheckdir | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/runcheckdir b/runcheckdir index 4964a4c..7dbfa2f 100755 --- a/runcheckdir +++ b/runcheckdir @@ -76,19 +76,15 @@ $details = join('', ); close CHECK; my $exitstatus = $? >> 8; -if ($exitstatus == 0) { - foreach my $command (@{$on{success}}) { - do_command $command; - } -} else { - foreach my $command (@{$on{failure}}) { - do_command $command; - } +my $command; +if ($exitstatus == 0 && $oldstatus != 0) { + do_command($command) foreach $command @{$on{success}}; +} +if ($exitstatus != 0 && $oldstatus == 0) { + do_command($command) foreach $command @{$on{failure}}; } if ($exitstatus != $oldstatus) { - foreach my $command(@{$on{change}}) { - do_command $command; - } + do_command($command) foreach $command @{$on{change}}; } open STATUS, ">$dir/checkstatus"; -- 2.25.1