fix port domain not added to host file. changes the proposed host name to not use vdm.dev

This commit is contained in:
Llewellyn van der Merwe 2021-07-12 11:32:10 +02:00
parent f50f87a454
commit b5693c9b91
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C

View File

@ -72,7 +72,7 @@ function traefik__TRuST__setup() {
while [ ${#VDM_DOMAIN} -le 1 ]; do while [ ${#VDM_DOMAIN} -le 1 ]; do
# get the value # get the value
VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \ VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \
"vdm.dev" 'Enter Main Domain') "${USER}.vdm" 'Enter Main Domain')
# keep asking if empty or does exist # keep asking if empty or does exist
[ ${#VDM_DOMAIN} -ge 1 ] || { [ ${#VDM_DOMAIN} -ge 1 ] || {
showError "You must enter a domain name!" showError "You must enter a domain name!"
@ -195,7 +195,7 @@ function portainer__TRuST__setup() {
while [ ${#VDM_DOMAIN} -le 1 ]; do while [ ${#VDM_DOMAIN} -le 1 ]; do
# get the value # get the value
VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \ VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \
"vdm.dev" 'Enter Main Domain') "${USER}.vdm" 'Enter Main Domain')
# keep asking if empty or does exist # keep asking if empty or does exist
[ ${#VDM_DOMAIN} -ge 1 ] || { [ ${#VDM_DOMAIN} -ge 1 ] || {
showError "You must enter a domain name!" showError "You must enter a domain name!"
@ -325,7 +325,7 @@ function joomla__TRuST__setup() {
while [ ${#VDM_DOMAIN} -le 1 ]; do while [ ${#VDM_DOMAIN} -le 1 ]; do
# get the value # get the value
VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \ VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \
"vdm.dev" 'Enter Main Domain') "${USER}.vdm" 'Enter Main Domain')
# keep asking if empty or does exist # keep asking if empty or does exist
[ ${#VDM_DOMAIN} -ge 1 ] || { [ ${#VDM_DOMAIN} -ge 1 ] || {
showError "You must enter a domain name!" showError "You must enter a domain name!"
@ -444,6 +444,8 @@ function joomla__TRuST__setup() {
export vdm_database_rootpass export vdm_database_rootpass
# set host file if needed # set host file if needed
updateHostFile updateHostFile
# also set the database domain
updateHostFile "${VDM_SUBDOMAIN}db"
# create the directory if it does not yet already exist # create the directory if it does not yet already exist
# shellcheck disable=SC2174 # shellcheck disable=SC2174
mkdir -p -m 700 "${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/available/${VDM_SUBDOMAIN}.${VDM_DOMAIN}" mkdir -p -m 700 "${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/available/${VDM_SUBDOMAIN}.${VDM_DOMAIN}"
@ -567,7 +569,7 @@ function openssh__TRuST__setup() {
while [ ${#VDM_DOMAIN} -le 1 ]; do while [ ${#VDM_DOMAIN} -le 1 ]; do
# get the value # get the value
VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \ VDM_DOMAIN=$(getInput "Enter main domain of all your containers.\n[only one main domain allowed for now, must have at least one dot]" \
"vdm.dev" 'Enter Main Domain') "${USER}.vdm" 'Enter Main Domain')
# keep asking if empty or does exist # keep asking if empty or does exist
[ ${#VDM_DOMAIN} -ge 1 ] || { [ ${#VDM_DOMAIN} -ge 1 ] || {
showError "You must enter a domain name!" showError "You must enter a domain name!"
@ -2126,7 +2128,7 @@ function updateHostFile() {
showNotice "${USER^}, ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} is already in the /etc/hosts file." showNotice "${USER^}, ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} is already in the /etc/hosts file."
elif (whiptail --yesno "${USER^}, to add the ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} entry to your host file we need sudo privileges." --title "Give sudo Privileges" 8 112); then elif (whiptail --yesno "${USER^}, to add the ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} entry to your host file we need sudo privileges." --title "Give sudo Privileges" 8 112); then
# add the domain to the host file # add the domain to the host file
echo "127.0.0.1 ${VDM_SUBDOMAIN}.${VDM_DOMAIN}" | sudo tee -a /etc/hosts >/dev/null echo "127.0.0.1 ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN}" | sudo tee -a /etc/hosts >/dev/null
# show notice # show notice
showNotice "${USER^}, ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} was added to the /etc/hosts file." showNotice "${USER^}, ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} was added to the /etc/hosts file."
fi fi