diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2019-07-16 14:20:30 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2019-07-16 14:20:30 +0300 |
commit | fa8bad20db100d95cf089b0b2d897c339327215c (patch) | |
tree | 2f80f2e015d26056cd741137dc4fdd069a6c4c5d /include/tests_kernel_hardening | |
parent | 2777caf6d218aeb40c2ebd8af2564be8201eeff1 (diff) |
Use -n instead of ! -z
Diffstat (limited to 'include/tests_kernel_hardening')
-rw-r--r-- | include/tests_kernel_hardening | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/tests_kernel_hardening b/include/tests_kernel_hardening index 71ed901e..eba7504d 100644 --- a/include/tests_kernel_hardening +++ b/include/tests_kernel_hardening @@ -47,7 +47,7 @@ done # Scan custom profile - if [ ! -z "${CUSTOM_PROFILE}" ]; then + if [ -n "${CUSTOM_PROFILE}" ]; then FIND=$(${GREPBINARY} "^config-data=sysctl;" ${CUSTOM_PROFILE} | ${SEDBINARY} 's/ /-space-/g') for LINE in ${FIND}; do SYSCTLKEY=$(echo ${LINE} | ${AWKBINARY} -F\; '{ print $2 }') @@ -57,7 +57,7 @@ fi # Last, use data from default profile - if [ ! -z "${DEFAULT_PROFILE}" ]; then + if [ -n "${DEFAULT_PROFILE}" ]; then FIND=$(${GREPBINARY} "^config-data=sysctl;" ${DEFAULT_PROFILE} | ${SEDBINARY} 's/ /-space-/g') for LINE in ${FIND}; do SYSCTLKEY=$(echo ${LINE} | ${AWKBINARY} -F\; '{ print $2 }') @@ -76,7 +76,7 @@ tFINDhp=$(echo ${line} | ${AWKBINARY} -F\; '{ print $4 }' | ${GREPBINARY} "[0-9]") tFINDdesc=$(echo ${line} | ${AWKBINARY} -F\; '{ print $5 }' | ${SEDBINARY} 's/-space-/ /g') tFINDcurvalue=$(${SYSCTL_READKEY} ${tFINDkey} 2> /dev/null) - if [ ! -z "${tFINDcurvalue}" ]; then + if [ -n "${tFINDcurvalue}" ]; then positive_match=0 for value in ${tFINDexpvalue}; do if [ "${value}" = "${tFINDcurvalue}" ]; then |