diff options
author | Jan Wagner <waja@cyconet.org> | 2017-01-06 16:54:29 +0100 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2017-01-06 16:54:29 +0100 |
commit | 439b93049ddcfa28d7d3b8dd8085770c613aabc3 (patch) | |
tree | a21e9044fc6cfb19dd1371f131407df91f18f2cd /plugins-scripts/check_log.sh | |
parent | 3fc149f4990358a91ca945f8b649a4c511722e73 (diff) | |
download | monitoring-plugins-439b93049ddcfa28d7d3b8dd8085770c613aabc3.tar.gz |
Fixing shellcheck SC2006
Diffstat (limited to 'plugins-scripts/check_log.sh')
-rwxr-xr-x | plugins-scripts/check_log.sh | 12 |
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 @@ | |||
60 | 60 | ||
61 | PATH="@TRUSTED_PATH@" | 61 | PATH="@TRUSTED_PATH@" |
62 | export PATH | 62 | export PATH |
63 | PROGNAME=`basename $0` | 63 | PROGNAME=$(basename $0) |
64 | PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` | 64 | PROGPATH=$(echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,') |
65 | REVISION="@NP_VERSION@" | 65 | REVISION="@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. |
182 | if [ -x /bin/mktemp ]; then | 182 | if [ -x /bin/mktemp ]; then |
183 | tempdiff=`/bin/mktemp /tmp/check_log.XXXXXXXXXX` | 183 | tempdiff=$(/bin/mktemp /tmp/check_log.XXXXXXXXXX) |
184 | else | 184 | else |
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 | |||
191 | diff $logfile $oldlog | grep -v "^>" > $tempdiff | 191 | diff $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 |
194 | count=`grep -c "$query" $tempdiff` | 194 | count=$(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 |
197 | lastentry=`grep "$query" $tempdiff | tail -1` | 197 | lastentry=$(grep "$query" $tempdiff | tail -1) |
198 | 198 | ||
199 | rm -f $tempdiff | 199 | rm -f $tempdiff |
200 | cat $logfile > $oldlog | 200 | cat $logfile > $oldlog |