Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lynis
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-08-26 15:05:20 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-08-26 15:05:20 +0300
commitfdf3ded89f7a205a69d150f2ba629f68ca46db5f (patch)
tree506553e28d73f10b15fcef040c521e038d291346 /lynis
parent8de53d87beefefca562e083d4b6722020c9c4f64 (diff)
New command 'lynis show details' to display test details
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis10
1 files changed, 7 insertions, 3 deletions
diff --git a/lynis b/lynis
index 9bf19a9a..b9402459 100755
--- a/lynis
+++ b/lynis
@@ -228,8 +228,12 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
if [ ${PRIVILEGED} -eq 0 ]; then
if [ "${LOGFILE}" = "" ]; then
# Try creating a log file in temporary directory
- touch /tmp/lynis.log
- if [ $? -eq 0 ]; then LOGFILE="/tmp/lynis.log"; else LOGFILE="/dev/null"; fi
+ if [ ! -f /tmp/lynis.log ]; then
+ touch /tmp/lynis.log
+ if [ $? -eq 0 ]; then LOGFILE="/tmp/lynis.log"; else LOGFILE="/dev/null"; fi
+ else
+ LOGFILE="/tmp/lynis.log"
+ fi
fi
if [ "${REPORTFILE}" = "" ]; then
touch /tmp/lynis-report.dat
@@ -477,7 +481,7 @@ ${NORMAL}
#
# Clear log file and test if it's writable
CDATE=$(date "+%Y-%m-%d %H:%M:%S")
- echo "${CDATE} Starting ${PROGRAM_NAME} ${PROGRAM_VERSION} with PID ${OURPID}, build date ${PROGRAM_RELEASE_DATE}" > ${LOGFILE}
+ if [ ${LOGTEXT} -eq 1 ]; then echo "${CDATE} Starting ${PROGRAM_NAME} ${PROGRAM_VERSION} with PID ${OURPID}, build date ${PROGRAM_RELEASE_DATE}" > ${LOGFILE}; fi
if [ $? -gt 0 ]; then
Display --indent 2 --text "- Clearing log file (${LOGFILE})... " --result WARNING --color RED
echo "${WARNING}Fatal error${NORMAL}: problem while writing to log file. Check location and permissions."