Allow automatic configuration of a setting

This commit is contained in:
Michael Boelen 2016-05-24 20:49:36 +02:00
parent 748039358c
commit a45d6e61f8
1 changed files with 7 additions and 3 deletions

View File

@ -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