Remove factor use in jenkins-sudo-grep.sh

Since puppet is gone, just probe for the log files and use which ever
exists.

Change-Id: Icf7af6d952d2d651526c36719219a074a751791e
This commit is contained in:
Ian Wienand 2017-05-02 19:40:44 +10:00
parent d51d6dc084
commit 1d1820971f
1 changed files with 10 additions and 10 deletions

View File

@ -19,16 +19,16 @@
# the auth.log or secure log files before and after a test run.
PATTERN="sudo.*jenkins.*:.*\(incorrect password attempts\|command not allowed\)"
case $( facter osfamily ) in
Debian)
OLDLOGFILE=/var/log/auth.log.1
LOGFILE=/var/log/auth.log
;;
RedHat)
OLDLOGFILE=$( ls /var/log/secure-* | sort | tail -n1 )
LOGFILE=/var/log/secure
;;
esac
if [ -f /var/log/auth.log ]; then
OLDLOGFILE=/var/log/auth.log.1
LOGFILE=/var/log/auth.log
elif [ -f /var/log/secure ]; then
OLDLOGFILE=$( ls /var/log/secure-* | sort | tail -n1 )
LOGFILE=/var/log/secure
else
echo "*** Could not find auth.log/secure log for sudo tracing"
exit 1
fi
case "$1" in
pre)