Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-05-24 21:49:36 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-05-24 21:49:36 +0300
commita45d6e61f89bc916c59a25bf18aece4d773276f6 (patch)
treea2f5a8f55e49662989f2ebd95179d9e3fce6a000 /include/helper_configure
parent748039358cbd3cdef7e500c0cfd52c2d9f70dc55 (diff)
Allow automatic configuration of a setting
Diffstat (limited to 'include/helper_configure')
-rw-r--r--include/helper_configure10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/helper_configure b/include/helper_configure
index 02c750f4..042f1a1d 100644
--- a/include/helper_configure
+++ b/include/helper_configure
@@ -80,19 +80,23 @@
#read VALUE
else
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
# Now check if value is in line with expected type (boolean, integer, string)
# =To be implemented=
done
${ECHOCMD} ""
- ${ECHOCMD} "${YELLOW}Note${NORMAL}: ${WHITE}Automatic configuration not fully implemented yet.${NORMAL}"
${ECHOCMD} ""
ExitClean
fi
-
ExitClean
-
# The End