diff options
Diffstat (limited to 'plugins-scripts/check_log.sh')
-rwxr-xr-x | plugins-scripts/check_log.sh | 10 |
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 @@ | |||
61 | PATH="" | 61 | PATH="" |
62 | 62 | ||
63 | ECHO="/bin/echo" | 63 | ECHO="/bin/echo" |
64 | GREP="/bin/grep" | 64 | GREP="/bin/egrep" |
65 | DIFF="/bin/diff" | 65 | DIFF="/bin/diff" |
66 | TAIL="/bin/tail" | 66 | TAIL="/bin/tail" |
67 | CAT="/bin/cat" | 67 | CAT="/bin/cat" |
68 | RM="/bin/rm" | 68 | RM="/bin/rm" |
69 | CHMOD="/bin/chmod" | ||
70 | TOUCH="/bin/touch" | ||
69 | 71 | ||
70 | PROGNAME=`/bin/basename $0` | 72 | PROGNAME=`/bin/basename $0` |
71 | PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` | 73 | PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` |
@@ -191,8 +193,8 @@ if [ -x /bin/mktemp ]; then | |||
191 | else | 193 | else |
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 |
196 | fi | 198 | fi |
197 | 199 | ||
198 | $DIFF $logfile $oldlog > $tempdiff | 200 | $DIFF $logfile $oldlog > $tempdiff |
@@ -201,7 +203,7 @@ $DIFF $logfile $oldlog > $tempdiff | |||
201 | count=`$GREP -c "$query" $tempdiff` | 203 | count=`$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 |
204 | lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1` | 206 | lastentry=`$GREP "$query" $tempdiff | $TAIL -1` |
205 | 207 | ||
206 | $RM -f $tempdiff | 208 | $RM -f $tempdiff |
207 | $CAT $logfile > $oldlog | 209 | $CAT $logfile > $oldlog |