adds readme and host

This commit is contained in:
2021-06-30 10:00:23 +02:00
parent 3564f8b93f
commit 8fe340c33e
4 changed files with 197 additions and 14 deletions

13
src/host.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# check if we should add to host file
if $VDM_UPDATE_HOST; then
# check if already in host file
if grep -q "${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN}" /etc/hosts; then
echo "[notice] ${USER^}, ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} is already in the /etc/hosts file."
else
# just a notice for now
echo "[notice] ${USER^}, you should add ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} to the /etc/hosts file."
# sudo echo "127.0.0.1 ${VDM_SUBDOMAIN}.${VDM_DOMAIN}" >> /etc/hosts
fi
fi

View File

@ -324,13 +324,8 @@ networks:
EOF
}
# add to the host file if not already set
#if [ $VDM_UPDATE_HOST ]; then
# grep -q "${VDM_SUBDOMAIN}.${VDM_DOMAIN}" /etc/hosts || {
# echo "[notice] Adding ${VDM_SUBDOMAIN}.${VDM_DOMAIN} to the /etc/hosts file."
# sudo echo "127.0.0.1 ${VDM_SUBDOMAIN}.${VDM_DOMAIN}" >> /etc/hosts
# }
#fi
# set host file if needed
source "${VDM_SRC_PATH}/host.sh"
# create the directory if it does not yet already exist
# shellcheck disable=SC2174

View File

@ -99,13 +99,8 @@ networks:
EOF
}
# add to the host file if not already set
#if [ $VDM_UPDATE_HOST ]; then
# grep -q "port.${VDM_DOMAIN}" /etc/hosts || {
# echo "[notice] Adding port.${VDM_DOMAIN} to the /etc/hosts file."
# sudo -- sh -c "127.0.0.1 port.${VDM_DOMAIN} >> /etc/hosts"
# }
#fi
# set host file if needed
source "${VDM_SRC_PATH}/host.sh" "port"
## create the directory if it does not yet already exist
# shellcheck disable=SC2174