diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-05-15 15:03:57 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-05-15 15:03:57 +0300 |
commit | 1cbf7244c29f92f4adf2ee9458b0eed487520c2d (patch) | |
tree | 501d46f36ac1f3e932457d9695c836ae14a37f43 /lynis | |
parent | 26c67e4ec677980b169b2056dff0e5315c2735d1 (diff) |
Added detection and display of profile directory
Diffstat (limited to 'lynis')
-rwxr-xr-x | lynis | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -267,6 +267,7 @@ ${NORMAL} if [ "${PROFILE}" = "" ]; then CUSTOM_PROFILE="" DEFAULT_PROFILE="" + PROFILEDIR="" tPROFILE_NAMES="default.prf custom.prf" tPROFILE_TARGETS="/usr/local/etc/lynis /etc/lynis /usr/local/lynis ." for PNAME in ${tPROFILE_NAMES}; do @@ -277,13 +278,15 @@ ${NORMAL} elif [ "${PNAME}" = "custom.prf" -a ! "${CUSTOM_PROFILE}" = "" ]; then Debug "Already discovered custom.prf - skipping this file (${PLOC}/${PNAME})" else - FILE="${PLOC}/${PNAME}" + if [ "${PLOC}" = "." ]; then FILE="${WORKDIR}/${PNAME}"; else FILE="${PLOC}/${PNAME}"; fi if [ -r ${FILE} ]; then PROFILES="${PROFILES} ${FILE}" case ${PNAME} in "custom.prf") CUSTOM_PROFILE="${FILE}" ;; "default.prf") DEFAULT_PROFILE="${FILE}" ;; esac + # Set profile directory to last match (Lynis could be both installed, and run as a separate download) + if [ "${PLOC}" = "." ]; then PROFILEDIR="${WORKDIR}"; else PROFILEDIR="${PLOC}"; fi fi fi done |