diff options
author | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-10 14:25:14 +0300 |
---|---|---|
committer | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-10 14:25:14 +0300 |
commit | 0c48fc3880551d862063e56a029ce43082df376a (patch) | |
tree | d57f59a582b3d457fccd0dad6f32b3513ebf294f /include/tests_boot_services | |
parent | c0378f38f517e916b141a8bc5049eb742e66d48f (diff) |
Optimized use of cat, grep and awk.
Detection of duplicate entries in /etc/hosts is now more robust.
On CentOS7 the SERVICE_MANAGER is detected correctly.
Diffstat (limited to 'include/tests_boot_services')
-rw-r--r-- | include/tests_boot_services | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/tests_boot_services b/include/tests_boot_services index 299c04c6..bf8f0af1 100644 --- a/include/tests_boot_services +++ b/include/tests_boot_services @@ -66,7 +66,7 @@ case ${OS} in "Linux") if [ -f /proc/1/cmdline ]; then - FILE=`cat /proc/1/cmdline | grep "^/" | awk '{ print $1 }'` + FILE=`awk '/^\// { print $1 }' /proc/1/cmdline` if [ ! "${FILE}" = "" ]; then if [ -L ${FILE} ]; then ShowSymlinkPath ${FILE} @@ -235,10 +235,10 @@ logtext "Found file ${GRUBCONFFILE}, proceeding with tests." FileIsReadable ${GRUBCONFFILE} if [ ${CANREAD} -eq 1 ]; then - FIND=`cat ${GRUBCONFFILE} | grep 'password --md5' | grep -v '^#'` - FIND2=`cat ${GRUBCONFFILE} | grep 'password --encrypted' | grep -v '^#'` - FIND3=`cat ${GRUBCONFFILE} | grep 'set superusers' | grep -v '^#'` - FIND4=`cat ${GRUBCONFFILE} | grep 'password_pbkdf2' | grep -v '^#'` + FIND=`grep 'password --md5' ${GRUBCONFFILE} | grep -v '^#'` + FIND2=`grep 'password --encrypted' ${GRUBCONFFILE} | grep -v '^#'` + FIND3=`grep 'set superusers' ${GRUBCONFFILE} | grep -v '^#'` + FIND4=`grep 'password_pbkdf2' ${GRUBCONFFILE} | grep -v '^#'` # GRUB1: MD5 or SHA1 if [ ! "${FIND}" = "" -o ! "${FIND2}" = "" ]; then FOUND=1 @@ -313,7 +313,7 @@ BOOT_LOADER_FOUND=1 Display --indent 2 --text "- Checking presence LILO" --result "OK" --color GREEN logtext "Checking password option LILO" - FIND=`cat ${LILOCONFFILE} | ${EGREPBINARY} 'password[[:space:]]?=' | grep -v "^#"` + FIND=`${EGREPBINARY} 'password[[:space:]]?=' ${LILOCONFFILE} | grep -v "^#"` if [ "${FIND}" = "" ]; then Display --indent 4 --text "- Password option presence " --result "WARNING" --color RED logtext "Result: no password set for LILO. Bootloader is unprotected to" |