mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-29 08:44:21 +02:00
Cleanups
This commit is contained in:
parent
352ea8c21c
commit
70607daa65
20
lynis
20
lynis
@ -82,7 +82,7 @@
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Drop out if our include directory can't be found
|
# Drop out if our include directory can't be found
|
||||||
if [ "${INCLUDEDIR}" = "" ]; then
|
if [ -z "${INCLUDEDIR}" ]; then
|
||||||
printf "%s" "
|
printf "%s" "
|
||||||
Fatal error: can't find include directory
|
Fatal error: can't find include directory
|
||||||
Make sure to execute ${PROGRAM_NAME} from untarred directory or check your installation."
|
Make sure to execute ${PROGRAM_NAME} from untarred directory or check your installation."
|
||||||
@ -127,7 +127,7 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
|
|||||||
else
|
else
|
||||||
MYID=$(id -u 2> /dev/null)
|
MYID=$(id -u 2> /dev/null)
|
||||||
fi
|
fi
|
||||||
if [ "${MYID}" = "" ]; then Display "Could not find user ID with id command. Want to help improving Lynis? Raise a ticket at ${PROGRAM_SOURCE}"; ExitFatal; fi
|
if [ -z "${MYID}" ]; then Display "Could not find user ID with id command. Want to help improving Lynis? Raise a ticket at ${PROGRAM_SOURCE}"; ExitFatal; fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
#
|
#
|
||||||
@ -307,7 +307,7 @@ ${NORMAL}
|
|||||||
# Decide where to write our PID file. For unprivileged users this will be in their home directory, or /tmp if their
|
# Decide where to write our PID file. For unprivileged users this will be in their home directory, or /tmp if their
|
||||||
# home directory isn't set. For root it will be /var/run, or the current working directory if /var/run doesn't exist.
|
# home directory isn't set. For root it will be /var/run, or the current working directory if /var/run doesn't exist.
|
||||||
MYHOMEDIR=$(echo ~ 2> /dev/null)
|
MYHOMEDIR=$(echo ~ 2> /dev/null)
|
||||||
if [ "${MYHOMEDIR}" = "" ]; then MYHOMEDIR="/tmp"; fi
|
if [ -z "${MYHOMEDIR}" ]; then MYHOMEDIR="/tmp"; fi
|
||||||
|
|
||||||
if [ ${PRIVILEGED} -eq 0 ]; then
|
if [ ${PRIVILEGED} -eq 0 ]; then
|
||||||
PIDFILE="${MYHOMEDIR}/lynis.pid"
|
PIDFILE="${MYHOMEDIR}/lynis.pid"
|
||||||
@ -446,7 +446,7 @@ ${NORMAL}
|
|||||||
|
|
||||||
"
|
"
|
||||||
sleep 3
|
sleep 3
|
||||||
if [ "${LOGFILE}" = "" -o "${LOGFILE}" = "/dev/null" ]; then
|
if [ -z "${LOGFILE}" -o "${LOGFILE}" = "/dev/null" ]; then
|
||||||
printf "%s" "
|
printf "%s" "
|
||||||
${RED}WARNING:${NORMAL}
|
${RED}WARNING:${NORMAL}
|
||||||
${WHITE}*${NORMAL} No suggestions or warnings will be displayed in report (due to missing log file)"
|
${WHITE}*${NORMAL} No suggestions or warnings will be displayed in report (due to missing log file)"
|
||||||
@ -569,7 +569,7 @@ ${NORMAL}
|
|||||||
#################################################################################
|
#################################################################################
|
||||||
#
|
#
|
||||||
# Plugin directory test
|
# Plugin directory test
|
||||||
if [ "${PLUGINDIR}" = "" ]; then
|
if [ -z "${PLUGINDIR}" ]; then
|
||||||
#LogText "Result: Searching for plugindir"
|
#LogText "Result: Searching for plugindir"
|
||||||
tPLUGIN_TARGETS="/usr/local/lynis/plugins /usr/local/share/lynis/plugins /usr/share/lynis/plugins /etc/lynis/plugins ./plugins"
|
tPLUGIN_TARGETS="/usr/local/lynis/plugins /usr/local/share/lynis/plugins /usr/share/lynis/plugins /etc/lynis/plugins ./plugins"
|
||||||
for I in ${tPLUGIN_TARGETS}; do
|
for I in ${tPLUGIN_TARGETS}; do
|
||||||
@ -602,7 +602,7 @@ ${NORMAL}
|
|||||||
echo " Operating system: ${OS}"
|
echo " Operating system: ${OS}"
|
||||||
echo " Operating system name: ${OS_NAME}"
|
echo " Operating system name: ${OS_NAME}"
|
||||||
echo " Operating system version: ${OS_VERSION}"
|
echo " Operating system version: ${OS_VERSION}"
|
||||||
if [ ! "${OS_MODE}" = "" ]; then echo " Operating system mode: ${OS_MODE}"; fi
|
if [ ! -z "${OS_MODE}" ]; then echo " Operating system mode: ${OS_MODE}"; fi
|
||||||
echo " Kernel version: ${OS_KERNELVERSION}"
|
echo " Kernel version: ${OS_KERNELVERSION}"
|
||||||
echo " Hardware platform: ${HARDWARE}"
|
echo " Hardware platform: ${HARDWARE}"
|
||||||
echo " Hostname: ${HOSTNAME}"
|
echo " Hostname: ${HOSTNAME}"
|
||||||
@ -624,9 +624,9 @@ ${NORMAL}
|
|||||||
LogText "Operating system: ${OS}"
|
LogText "Operating system: ${OS}"
|
||||||
LogText "Operating system name: ${OS_NAME}"
|
LogText "Operating system name: ${OS_NAME}"
|
||||||
LogText "Operating system version: ${OS_VERSION}"
|
LogText "Operating system version: ${OS_VERSION}"
|
||||||
if [ ! "${OS_MODE}" = "" ]; then LogText "Operating system mode: ${OS_MODE}"; fi
|
if [ ! -z "${OS_MODE}" ]; then LogText "Operating system mode: ${OS_MODE}"; fi
|
||||||
LogText "Kernel version: ${OS_KERNELVERSION}"
|
LogText "Kernel version: ${OS_KERNELVERSION}"
|
||||||
if [ ! "${OS_KERNELVERSION_FULL}" = "" ]; then
|
if [ ! -z "${OS_KERNELVERSION_FULL}" ]; then
|
||||||
LogText "Kernel version (full): ${OS_KERNELVERSION_FULL}"
|
LogText "Kernel version (full): ${OS_KERNELVERSION_FULL}"
|
||||||
fi
|
fi
|
||||||
LogText "Hardware platform: ${HARDWARE}"
|
LogText "Hardware platform: ${HARDWARE}"
|
||||||
@ -666,7 +666,7 @@ ${NORMAL}
|
|||||||
CheckUpdates
|
CheckUpdates
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${PROGRAM_AC}" = "" -o "${PROGRAM_LV}" = "" ]; then
|
if [ -z "${PROGRAM_AC}" -o -z "${PROGRAM_LV}" ]; then
|
||||||
Display --indent 2 --text "- Program update status... " --result UNKNOWN --color YELLOW
|
Display --indent 2 --text "- Program update status... " --result UNKNOWN --color YELLOW
|
||||||
LogText "Result: Update check failed. No network connection?"
|
LogText "Result: Update check failed. No network connection?"
|
||||||
LogText "Info: to perform an automatic update check, outbound DNS connections should be allowed (TXT record)."
|
LogText "Info: to perform an automatic update check, outbound DNS connections should be allowed (TXT record)."
|
||||||
@ -836,7 +836,7 @@ ${NORMAL}
|
|||||||
for PROFILE in ${PROFILES}; do
|
for PROFILE in ${PROFILES}; do
|
||||||
LogText "Action: checking plugin status in profile: ${PROFILE}"
|
LogText "Action: checking plugin status in profile: ${PROFILE}"
|
||||||
FIND3=$(grep "^plugin=${FIND2}" ${PROFILE})
|
FIND3=$(grep "^plugin=${FIND2}" ${PROFILE})
|
||||||
if [ ! "${FIND3}" = "" ]; then
|
if [ ! -z "${FIND3}" ]; then
|
||||||
LogText "Result: plugin enabled in profile (${PROFILE})"
|
LogText "Result: plugin enabled in profile (${PROFILE})"
|
||||||
PLUGIN_ENABLED_STATE=1
|
PLUGIN_ENABLED_STATE=1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user