summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e2e455a)
raw | patch | inline | side by side (parent: e2e455a)
author | M. Sean Finney <seanius@users.sourceforge.net> | |
Sat, 29 Oct 2005 15:38:40 +0000 (15:38 +0000) | ||
committer | M. Sean Finney <seanius@users.sourceforge.net> | |
Sat, 29 Oct 2005 15:38:40 +0000 (15:38 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1263 f882894a-f735-0410-b71e-b25c423dba1c
plugins-scripts/check_log.sh | patch | blob | history |
index 0da732d2a28f8f007a5acaff29db39a712af6cba..8145bba935b60aa0d228058baaddd7af5223023e 100755 (executable)
PATH=""
ECHO="/bin/echo"
-GREP="/bin/grep"
+GREP="/bin/egrep"
DIFF="/bin/diff"
TAIL="/bin/tail"
CAT="/bin/cat"
RM="/bin/rm"
+CHMOD="/bin/chmod"
+TOUCH="/bin/touch"
PROGNAME=`/bin/basename $0`
PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'`
else
tempdiff=`/bin/date '+%H%M%S'`
tempdiff="/tmp/check_log.${tempdiff}"
- /bin/touch $tempdiff
- chmod 600 $tempdiff
+ $TOUCH $tempdiff
+ $CHMOD 600 $tempdiff
fi
$DIFF $logfile $oldlog > $tempdiff
count=`$GREP -c "$query" $tempdiff`
# Get the last matching entry in the diff file
-lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1`
+lastentry=`$GREP "$query" $tempdiff | $TAIL -1`
$RM -f $tempdiff
$CAT $logfile > $oldlog