Changed runcheckdir so that failure and success only trigger once per change
authorChip Black <bytex64@bytex64.net>
Mon, 18 Aug 2008 07:13:17 +0000 (02:13 -0500)
committerChip Black <bytex64@bytex64.net>
Mon, 18 Aug 2008 07:13:17 +0000 (02:13 -0500)
runcheckdir

index 4964a4c..7dbfa2f 100755 (executable)
@@ -76,19 +76,15 @@ $details = join('', <CHECK>);
 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";