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
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2017-03-14 18:41:47 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-03-14 18:41:47 +0300
commit70607daa658bff811d28312da7bb4f0fd3420a5a (patch)
tree46f72538b49fae1ca93922cf6ef3668bf5d18680
parent352ea8c21c428a5c8aa78d9cae967e00bb3dabae (diff)
Cleanups
-rwxr-xr-xlynis20
1 files changed, 10 insertions, 10 deletions
diff --git a/lynis b/lynis
index 7aa91955..980b6637 100755
--- a/lynis
+++ b/lynis
@@ -82,7 +82,7 @@
done
# Drop out if our include directory can't be found
- if [ "${INCLUDEDIR}" = "" ]; then
+ if [ -z "${INCLUDEDIR}" ]; then
printf "%s" "
Fatal error: can't find include directory
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
MYID=$(id -u 2> /dev/null)
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
# 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)
- if [ "${MYHOMEDIR}" = "" ]; then MYHOMEDIR="/tmp"; fi
+ if [ -z "${MYHOMEDIR}" ]; then MYHOMEDIR="/tmp"; fi
if [ ${PRIVILEGED} -eq 0 ]; then
PIDFILE="${MYHOMEDIR}/lynis.pid"
@@ -446,7 +446,7 @@ ${NORMAL}
"
sleep 3
- if [ "${LOGFILE}" = "" -o "${LOGFILE}" = "/dev/null" ]; then
+ if [ -z "${LOGFILE}" -o "${LOGFILE}" = "/dev/null" ]; then
printf "%s" "
${RED}WARNING:${NORMAL}
${WHITE}*${NORMAL} No suggestions or warnings will be displayed in report (due to missing log file)"
@@ -569,7 +569,7 @@ ${NORMAL}
#################################################################################
#
# Plugin directory test
- if [ "${PLUGINDIR}" = "" ]; then
+ if [ -z "${PLUGINDIR}" ]; then
#LogText "Result: Searching for plugindir"
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
@@ -602,7 +602,7 @@ ${NORMAL}
echo " Operating system: ${OS}"
echo " Operating system name: ${OS_NAME}"
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 " Hardware platform: ${HARDWARE}"
echo " Hostname: ${HOSTNAME}"
@@ -624,9 +624,9 @@ ${NORMAL}
LogText "Operating system: ${OS}"
LogText "Operating system name: ${OS_NAME}"
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}"
- if [ ! "${OS_KERNELVERSION_FULL}" = "" ]; then
+ if [ ! -z "${OS_KERNELVERSION_FULL}" ]; then
LogText "Kernel version (full): ${OS_KERNELVERSION_FULL}"
fi
LogText "Hardware platform: ${HARDWARE}"
@@ -666,7 +666,7 @@ ${NORMAL}
CheckUpdates
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
LogText "Result: Update check failed. No network connection?"
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
LogText "Action: checking plugin status in profile: ${PROFILE}"
FIND3=$(grep "^plugin=${FIND2}" ${PROFILE})
- if [ ! "${FIND3}" = "" ]; then
+ if [ ! -z "${FIND3}" ]; then
LogText "Result: plugin enabled in profile (${PROFILE})"
PLUGIN_ENABLED_STATE=1
fi