From b8f9d73a94c0950acc99f9a01470b3afb9e26340 Mon Sep 17 00:00:00 2001 From: Andreas Bachlechner Date: Fri, 24 Sep 2021 11:15:43 +0200 Subject: [PATCH] Add arguemt usage to cmd option in ambsens. --- lib/ambsens.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ambsens.pm b/lib/ambsens.pm index 739d7da..488c361 100644 --- a/lib/ambsens.pm +++ b/lib/ambsens.pm @@ -145,11 +145,12 @@ sub ambsens_update { my $e2 = 1; foreach my $dl (split(',', $ambsens->{desc}->{$e})) { my $str = trim($dl); - my $script = trim($ambsens->{cmd}->{$str}); + my $scriptWithArguments = trim($ambsens->{cmd}->{$str}); + my $script = (split(' ', $scriptWithArguments))[0]; if($script) { if(-x $script) { - my $val = `$script`; + my $val = `$scriptWithArguments`; chomp($val); $sens[$e][$e2] = $val;