Set configuration file location
This commit is contained in:
parent
4a70e40c1c
commit
de13d76d65
|
@ -126,16 +126,21 @@ function write_config_param {
|
||||||
|
|
||||||
if [ ${#param_name} -gt 0 ]; then
|
if [ ${#param_name} -gt 0 ]; then
|
||||||
if [ ${#param_value} -gt 0 ]; then
|
if [ ${#param_value} -gt 0 ]; then
|
||||||
if [ $CONFIGURATION_FILE ]; then
|
# set configuration file location if needed
|
||||||
if [ -f $CONFIGURATION_FILE ]; then
|
test_config_file="$CONFIGURATION_FILE"
|
||||||
if grep -q "${param_name}=" $CONFIGURATION_FILE; then
|
if [ ${#test_config_file} -eq 0 ]; then
|
||||||
sed -i "s|${param_name}=.*|${param_name}=${param_value}|g" $CONFIGURATION_FILE
|
$CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||||
else
|
fi
|
||||||
echo "${param_name}=${param_value}" >> $CONFIGURATION_FILE
|
|
||||||
fi
|
# update the configuration file
|
||||||
|
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
|
||||||
else
|
else
|
||||||
echo "${param_name}=${param_value}" > $CONFIGURATION_FILE
|
echo "${param_name}=${param_value}" >> $CONFIGURATION_FILE
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "${param_name}=${param_value}" > $CONFIGURATION_FILE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue