aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_log.sh
diff options
context:
space:
mode:
authorGravatar Jan Wagner <waja@cyconet.org> 2017-01-06 16:54:29 +0100
committerGravatar Jan Wagner <waja@cyconet.org> 2017-01-06 16:54:29 +0100
commit439b93049ddcfa28d7d3b8dd8085770c613aabc3 (patch)
treea21e9044fc6cfb19dd1371f131407df91f18f2cd /plugins-scripts/check_log.sh
parent3fc149f4990358a91ca945f8b649a4c511722e73 (diff)
downloadmonitoring-plugins-439b93049ddcfa28d7d3b8dd8085770c613aabc3.tar.gz
Fixing shellcheck SC2006
Diffstat (limited to 'plugins-scripts/check_log.sh')
-rwxr-xr-xplugins-scripts/check_log.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh
index d28c8d0a..45992687 100755
--- a/plugins-scripts/check_log.sh
+++ b/plugins-scripts/check_log.sh
@@ -60,8 +60,8 @@
PATH="@TRUSTED_PATH@"
export PATH
-PROGNAME=`basename $0`
-PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
+PROGNAME=$(basename $0)
+PROGPATH=$(echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,')
REVISION="@NP_VERSION@"
. $PROGPATH/utils.sh
@@ -180,9 +180,9 @@ fi
# The temporary file that the script should use while
# processing the log file.
if [ -x /bin/mktemp ]; then
- tempdiff=`/bin/mktemp /tmp/check_log.XXXXXXXXXX`
+ tempdiff=$(/bin/mktemp /tmp/check_log.XXXXXXXXXX)
else
- tempdiff=`/bin/date '+%H%M%S'`
+ tempdiff=$(/bin/date '+%H%M%S')
tempdiff="/tmp/check_log.${tempdiff}"
touch $tempdiff
chmod 600 $tempdiff
@@ -191,10 +191,10 @@ fi
diff $logfile $oldlog | grep -v "^>" > $tempdiff
# Count the number of matching log entries we have
-count=`grep -c "$query" $tempdiff`
+count=$(grep -c "$query" $tempdiff)
# Get the last matching entry in the diff file
-lastentry=`grep "$query" $tempdiff | tail -1`
+lastentry=$(grep "$query" $tempdiff | tail -1)
rm -f $tempdiff
cat $logfile > $oldlog