Remove IP detection logic
This code was here to check if user will get an admin certificate. It doesn't work well for intranet cloudron's. The check is also not complete since just DNS is not enough for LE to succeed, we also require port forwarding.
This commit is contained in:
@@ -7,43 +7,6 @@ if [[ ${EUID} -ne 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ask() {
|
||||
# http://djm.me/ask
|
||||
local prompt default REPLY
|
||||
|
||||
while true; do
|
||||
|
||||
if [ "${2:-}" = "Y" ]; then
|
||||
prompt="Y/n"
|
||||
default=Y
|
||||
elif [ "${2:-}" = "N" ]; then
|
||||
prompt="y/N"
|
||||
default=N
|
||||
else
|
||||
prompt="y/n"
|
||||
default=
|
||||
fi
|
||||
|
||||
# Ask the question (not using "read -p" as it uses stderr not stdout)
|
||||
echo -n "$1 [$prompt] "
|
||||
|
||||
# Read the answer (use /dev/tty in case stdin is redirected from somewhere else)
|
||||
read REPLY </dev/tty
|
||||
|
||||
# Default?
|
||||
if [ -z "$REPLY" ]; then
|
||||
REPLY=$default
|
||||
fi
|
||||
|
||||
# Check if the reply is valid
|
||||
case "$REPLY" in
|
||||
Y*|y*) return 0 ;;
|
||||
N*|n*) return 1 ;;
|
||||
esac
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
# change this to a hash when we make a upgrade release
|
||||
readonly INSTALLER_REVISION=master
|
||||
readonly INIT_BASESYSTEM_SCRIPT_URL="https://git.cloudron.io/cloudron/box/raw/${INSTALLER_REVISION}/baseimage/initializeBaseUbuntuImage.sh"
|
||||
@@ -122,23 +85,6 @@ if ! apt-get install curl dnsutils -y &>> "${LOG_FILE}"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ip=$(dig a "my.${domain}" +short)
|
||||
echo ""
|
||||
if [[ -z "${ip}" ]]; then
|
||||
echo "No DNS A record found for my.${domain}"
|
||||
echo "First create a new DNS A record for my.${domain} pointing to the public ip address of this server."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Found DNS A record for my.${domain} pointing to:"
|
||||
echo "${ip}"
|
||||
echo ""
|
||||
if ! ask "Is this correct?"; then
|
||||
echo "Please ensure that the A record for my.${domain} is pointing to the correct public ip address of this server."
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "=> Downloading initialization script"
|
||||
if ! curl -s "${INIT_BASESYSTEM_SCRIPT_URL}" > /tmp/initializeBaseUbuntuImage.sh; then
|
||||
echo "Could not download initialization script"
|
||||
|
||||
Reference in New Issue
Block a user