summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_log.sh
diff options
context:
space:
mode:
authorJan Wagner <waja@cyconet.org>2017-01-06 15:54:29 (GMT)
committerJan Wagner <waja@cyconet.org>2017-01-06 15:54:29 (GMT)
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 d28c8d0..4599268 100755
--- a/plugins-scripts/check_log.sh
+++ b/plugins-scripts/check_log.sh
@@ -60,8 +60,8 @@
60 60
61PATH="@TRUSTED_PATH@" 61PATH="@TRUSTED_PATH@"
62export PATH 62export PATH
63PROGNAME=`basename $0` 63PROGNAME=$(basename $0)
64PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` 64PROGPATH=$(echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,')
65REVISION="@NP_VERSION@" 65REVISION="@NP_VERSION@"
66 66
67. $PROGPATH/utils.sh 67. $PROGPATH/utils.sh
@@ -180,9 +180,9 @@ fi
180# The temporary file that the script should use while 180# The temporary file that the script should use while
181# processing the log file. 181# processing the log file.
182if [ -x /bin/mktemp ]; then 182if [ -x /bin/mktemp ]; then
183 tempdiff=`/bin/mktemp /tmp/check_log.XXXXXXXXXX` 183 tempdiff=$(/bin/mktemp /tmp/check_log.XXXXXXXXXX)
184else 184else
185 tempdiff=`/bin/date '+%H%M%S'` 185 tempdiff=$(/bin/date '+%H%M%S')
186 tempdiff="/tmp/check_log.${tempdiff}" 186 tempdiff="/tmp/check_log.${tempdiff}"
187 touch $tempdiff 187 touch $tempdiff
188 chmod 600 $tempdiff 188 chmod 600 $tempdiff
@@ -191,10 +191,10 @@ fi
191diff $logfile $oldlog | grep -v "^>" > $tempdiff 191diff $logfile $oldlog | grep -v "^>" > $tempdiff
192 192
193# Count the number of matching log entries we have 193# Count the number of matching log entries we have
194count=`grep -c "$query" $tempdiff` 194count=$(grep -c "$query" $tempdiff)
195 195
196# Get the last matching entry in the diff file 196# Get the last matching entry in the diff file
197lastentry=`grep "$query" $tempdiff | tail -1` 197lastentry=$(grep "$query" $tempdiff | tail -1)
198 198
199rm -f $tempdiff 199rm -f $tempdiff
200cat $logfile > $oldlog 200cat $logfile > $oldlog