From a025295971e7f8d88764c7d54fb29379b9f29b8d Mon Sep 17 00:00:00 2001 From: Tom Throckmorton Date: Fri, 6 Mar 2009 19:28:26 +0100 Subject: [PATCH] contrib/exec-nagios.px: Make it possible to run the same script multiple times. --- contrib/exec-nagios.px | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/exec-nagios.px b/contrib/exec-nagios.px index 3a847241..a9f46633 100755 --- a/contrib/exec-nagios.px +++ b/contrib/exec-nagios.px @@ -123,8 +123,20 @@ sub handle_config_script } else { - $opts->{'script'} = $script; - push (@$Scripts, $opts); + if (ref ($opts) eq 'ARRAY') + { + for (@$opts) + { + my $opt = $_; + $opt->{'script'} = $script; + push (@$Scripts, $opt); + } + } + else + { + $opts->{'script'} = $script; + push (@$Scripts, $opts); + } } } # for (keys %$scripts) } # handle_config_script -- 2.30.2