This commit is contained in:
Bob Mottram 2016-10-11 13:25:26 +01:00
parent f1ba82984a
commit f3a6124fe1
2 changed files with 10 additions and 13 deletions

View File

@ -124,15 +124,12 @@ function write_config_param {
param_name="$1"
param_value="$2"
if [ ${#param_name} -gt 0 ]; then
if [ ${#param_value} -gt 0 ]; then
# set configuration file location if needed
test_config_file="$CONFIGURATION_FILE"
if [ ${#test_config_file} -eq 0 ]; then
$CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
if [ ! $CONFIGURATION_FILE ]; then
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
fi
# update the configuration file
if [ ${#param_name} -gt 0 ]; then
if [ ${#param_value} -gt 0 ]; then
if [ -f $CONFIGURATION_FILE ]; then
if grep -q "${param_name}=" $CONFIGURATION_FILE; then
sed -i "s|${param_name}=.*|${param_name}=${param_value}|g" $CONFIGURATION_FILE
@ -147,10 +144,6 @@ function write_config_param {
}
function save_configuration_values {
if [ ! $CONFIGURATION_FILE ]; then
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
fi
for v in "${configuration_variables[@]}"
do
write_config_param "$v" "${!v}"

View File

@ -35,10 +35,14 @@ fi
DEFAULT_DOMAIN_NAME=
DEFAULT_DOMAIN_CODE=
MY_USERNAME=
if [ ! $SYSTEM_TYPE ]; then
SYSTEM_TYPE="full"
fi
# An optional configuration file which overrides some of these variables
if [ ! $CONFIGURATION_FILE ]; then
CONFIGURATION_FILE="$HOME/${PROJECT_NAME}.cfg"
fi
# Directory where source code is downloaded and compiled
INSTALL_DIR=$HOME/build