mirror of https://github.com/CISOfy/lynis.git
Allow automatic configuration of a setting
This commit is contained in:
parent
748039358c
commit
a45d6e61f8
|
@ -80,19 +80,23 @@
|
||||||
#read VALUE
|
#read VALUE
|
||||||
else
|
else
|
||||||
Debug "Setting '${SETTING}' should be configured with value '${VALUE}'"
|
Debug "Setting '${SETTING}' should be configured with value '${VALUE}'"
|
||||||
|
FIND=$(grep "^${SETTING}" ${CUSTOM_PROFILE})
|
||||||
|
if [ "${FIND}" = "" ]; then
|
||||||
|
${ECHOCMD} "Configuring setting '${CYAN}${SETTING}${NORMAL}'"
|
||||||
|
echo "${SETTING}=${VALUE}" >> ${CUSTOM_PROFILE}
|
||||||
|
else
|
||||||
|
${ECHOCMD} "${RED}Error${NORMAL}: Setting '${CYAN}${SETTING}${NORMAL}' was already configured:${NORMAL} ${WHITE}${FIND}${NORMAL}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# Now check if value is in line with expected type (boolean, integer, string)
|
# Now check if value is in line with expected type (boolean, integer, string)
|
||||||
# =To be implemented=
|
# =To be implemented=
|
||||||
done
|
done
|
||||||
${ECHOCMD} ""
|
${ECHOCMD} ""
|
||||||
${ECHOCMD} "${YELLOW}Note${NORMAL}: ${WHITE}Automatic configuration not fully implemented yet.${NORMAL}"
|
|
||||||
${ECHOCMD} ""
|
${ECHOCMD} ""
|
||||||
ExitClean
|
ExitClean
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
ExitClean
|
ExitClean
|
||||||
|
|
||||||
|
|
||||||
# The End
|
# The End
|
||||||
|
|
Loading…
Reference in New Issue