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_shells | |
parent | 2777caf6d218aeb40c2ebd8af2564be8201eeff1 (diff) |
Use -n instead of ! -z
Diffstat (limited to 'include/tests_shells')
-rw-r--r-- | include/tests_shells | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/tests_shells b/include/tests_shells index 3a094ad8..8e97ae86 100644 --- a/include/tests_shells +++ b/include/tests_shells @@ -126,7 +126,7 @@ FIND=$(${GREPBINARY} 'TMOUT=' ${ROOTDIR}etc/profile | ${TRBINARY} -d ' ' | ${TRBINARY} -d '\t' | ${GREPBINARY} -v "^#" | ${SEDBINARY} 's/export//' | ${SEDBINARY} 's/#.*//' | ${AWKBINARY} -F= '{ print $2 }') # Determine if the value is exported (with export, readonly, or typeset) FIND2=$(${GREPBINARY} '\(export\|readonly\|typeset -r\)[ \t]*TMOUT' ${ROOTDIR}etc/profile | ${GREPBINARY} -v "^#" | ${SEDBINARY} 's/#.*//' | ${AWKBINARY} '{ print $1 }') - if [ ! -z "${FIND}" ]; then + if [ -n "${FIND}" ]; then N=0; IDLE_TIMEOUT=1 for I in ${FIND}; do LogText "Output: ${I}" @@ -143,7 +143,7 @@ LogText "Result: could not find TMOUT setting in ${ROOTDIR}etc/profile" fi - if [ ! -z "${FIND2}" ]; then + if [ -n "${FIND2}" ]; then N=0; for I in ${FIND2}; do LogText "Output: ${I}" @@ -167,12 +167,12 @@ if [ -d ${ROOTDIR}etc/profile.d ]; then FIND=$(${LSBINARY} ${ROOTDIR}etc/profile.d/*.sh 2> /dev/null) - if [ ! -z "${FIND}" ]; then + if [ -n "${FIND}" ]; then # Determine if we can find a TMOUT value FIND=$(${FINDBINARY} ${ROOTDIR}etc/profile.d -name "*.sh" -type f -exec cat {} \; 2> /dev/null | ${GREPBINARY} 'TMOUT=' | ${TRBINARY} -d ' ' | ${TRBINARY} -d '\t' | ${GREPBINARY} -v "^#" | ${SEDBINARY} 's/export//' | ${SEDBINARY} 's/#.*//' | ${AWKBINARY} -F= '{ print $2 }') # Determine if the value is exported (with export, readonly, or typeset) FIND2=$(${FINDBINARY} ${ROOTDIR}etc/profile.d -name "*.sh" -type f -exec cat {} \; 2> /dev/null | ${GREPBINARY} '\(export\|readonly\|typeset -r\)[ \t]*TMOUT' | ${GREPBINARY} -v "^#" | ${SEDBINARY} 's/#.*//' | ${AWKBINARY} '{ print $1 }') - if [ ! -z "${FIND}" ]; then + if [ -n "${FIND}" ]; then N=0; IDLE_TIMEOUT=1 for I in ${FIND}; do LogText "Output: ${I}" @@ -189,7 +189,7 @@ LogText "Result: could not find TMOUT setting in ${ROOTDIR}etc/profile.d/*.sh" fi # Check for readonly - if [ ! -z "${FIND2}" ]; then + if [ -n "${FIND2}" ]; then N=0; for I in ${FIND2}; do LogText "Output: ${I}" @@ -212,10 +212,10 @@ LogText "Result: skip ${ROOTDIR}etc/profile.d directory test, directory not available on this system" fi - if [ ! -z "${IDLE_TIMEOUT_METHOD}" ]; then + if [ -n "${IDLE_TIMEOUT_METHOD}" ]; then Report "session_timeout_method[]=${IDLE_TIMEOUT_METHOD}" fi - if [ ! -z "${IDLE_TIMEOUT_READONLY}" ]; then + if [ -n "${IDLE_TIMEOUT_READONLY}" ]; then Report "session_timeout_set_readonly=${IDLE_TIMEOUT_READONLY}" fi |