From a45d6e61f89bc916c59a25bf18aece4d773276f6 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Tue, 24 May 2016 20:49:36 +0200 Subject: [PATCH] Allow automatic configuration of a setting --- include/helper_configure | 10 +++++++--- 1 file 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