summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_log.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh
index 0da732d2..8145bba9 100755
--- a/plugins-scripts/check_log.sh
+++ b/plugins-scripts/check_log.sh
@@ -61,11 +61,13 @@
61PATH="" 61PATH=""
62 62
63ECHO="/bin/echo" 63ECHO="/bin/echo"
64GREP="/bin/grep" 64GREP="/bin/egrep"
65DIFF="/bin/diff" 65DIFF="/bin/diff"
66TAIL="/bin/tail" 66TAIL="/bin/tail"
67CAT="/bin/cat" 67CAT="/bin/cat"
68RM="/bin/rm" 68RM="/bin/rm"
69CHMOD="/bin/chmod"
70TOUCH="/bin/touch"
69 71
70PROGNAME=`/bin/basename $0` 72PROGNAME=`/bin/basename $0`
71PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` 73PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'`
@@ -191,8 +193,8 @@ if [ -x /bin/mktemp ]; then
191else 193else
192 tempdiff=`/bin/date '+%H%M%S'` 194 tempdiff=`/bin/date '+%H%M%S'`
193 tempdiff="/tmp/check_log.${tempdiff}" 195 tempdiff="/tmp/check_log.${tempdiff}"
194 /bin/touch $tempdiff 196 $TOUCH $tempdiff
195 chmod 600 $tempdiff 197 $CHMOD 600 $tempdiff
196fi 198fi
197 199
198$DIFF $logfile $oldlog > $tempdiff 200$DIFF $logfile $oldlog > $tempdiff
@@ -201,7 +203,7 @@ $DIFF $logfile $oldlog > $tempdiff
201count=`$GREP -c "$query" $tempdiff` 203count=`$GREP -c "$query" $tempdiff`
202 204
203# Get the last matching entry in the diff file 205# Get the last matching entry in the diff file
204lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1` 206lastentry=`$GREP "$query" $tempdiff | $TAIL -1`
205 207
206$RM -f $tempdiff 208$RM -f $tempdiff
207$CAT $logfile > $oldlog 209$CAT $logfile > $oldlog