Try to obtain domain name from config file

This commit is contained in:
Bob Mottram 2018-02-02 16:16:48 +00:00
parent 642ddc47f9
commit 467f6c22ab
2 changed files with 9 additions and 1 deletions

View File

@ -266,7 +266,6 @@ function install_edith {
fi
fi
if [ -d /var/www/$EDITH_DOMAIN_NAME/htdocs ]; then
rm -rf /var/www/$EDITH_DOMAIN_NAME/htdocs
fi

View File

@ -174,6 +174,15 @@ function get_app_icann_address {
if grep -q "${app_name} domain" $COMPLETION_FILE; then
echo $(cat ${COMPLETION_FILE} | grep "${app_name} domain" | head -n 1 | awk -F ':' '{print $2}')
return
else
app_name_upper=$(echo "$app_name" | tr '[:lower:]' '[:upper:]')_DOMAIN_NAME
if [ $app_name_upper ]; then
param_value=$(cat $CONFIGURATION_FILE | grep "${app_name_upper}=" | head -n 1 | awk -F '=' '{print $2}')
if [ ${param_value} ]; then
echo ${param_value}
return
fi
fi
fi
echo "${DEFAULT_DOMAIN_NAME}"
}