Files
cloudron-box/setup/start/cloudron-motd

62 lines
2.5 KiB
Plaintext
Raw Normal View History

2019-02-05 09:52:15 -08:00
#!/bin/bash
2019-02-05 14:58:44 -08:00
[[ -f /etc/update-motd.d/91-cloudron-install-in-progress ]] && exit
2019-02-07 14:07:30 -08:00
printf "**********************************************************************\n\n"
readonly cache_file4="/var/cache/cloudron-motd-cache4"
readonly cache_file6="/var/cache/cloudron-motd-cache6"
url4=""
url6=""
fallbackUrl=""
function detectIp() {
if [[ ! -f "${cache_file4}" ]]; then
ip4=$(curl -s --fail --connect-timeout 2 --max-time 2 https://ipv4.api.cloudron.io/api/v1/helper/public_ip | sed -n -e 's/.*"ip": "\(.*\)"/\1/p' || true)
[[ -n "${ip4}" ]] && echo "${ip4}" > "${cache_file4}"
else
ip4=$(cat "${cache_file4}")
fi
if [[ ! -f "${cache_file6}" ]]; then
ip6=$(curl -s --fail --connect-timeout 2 --max-time 2 https://ipv6.api.cloudron.io/api/v1/helper/public_ip | sed -n -e 's/.*"ip": "\(.*\)"/\1/p' || true)
[[ -n "${ip6}" ]] && echo "${ip6}" > "${cache_file6}"
else
ip6=$(cat "${cache_file6}")
2020-03-09 14:33:48 -07:00
fi
[[ -n "${ip4}" ]] && url4="https://${ip4}"
[[ -n "${ip6}" ]] && url6="https://[${ip6}]"
[[ -z "${ip4}" && -z "${ip6}" ]] && fallbackUrl="https://<IP>"
}
if [[ -z "$(ls -A /home/yellowtent/platformdata/addons/mail/dkim)" ]]; then
detectIp
2019-02-05 16:51:27 -08:00
printf "\t\t\tWELCOME TO CLOUDRON\n"
printf "\t\t\t-------------------\n"
2019-02-05 09:52:15 -08:00
2024-04-19 18:32:25 +02:00
printf '\n\e[1;32m%-6s\e[m\n' "Visit one of the following URLs and accept the self-signed certificate to finish setup."
[[ -n "${url4}" ]] && printf '\e[1;32m%-6s\e[m\n' " * ${url4}"
[[ -n "${url6}" ]] && printf '\e[1;32m%-6s\e[m\n' " * ${url6}"
[[ -n "${fallbackUrl}" ]] && printf '\e[1;32m%-6s\e[m\n' " * ${fallbackUrl}"
printf "\nCloudron overview - https://docs.cloudron.io/ \n"
2020-09-15 14:46:22 -07:00
printf "Cloudron setup - https://docs.cloudron.io/installation/#setup \n"
2019-02-05 16:51:27 -08:00
else
printf "\t\t\tNOTE TO CLOUDRON ADMINS\n"
printf "\t\t\t-----------------------\n"
printf "Please do not run apt upgrade manually as it will update packages that\n"
2025-01-27 22:02:29 +01:00
printf "Cloudron relies on and may break the installation. Ubuntu security\n"
printf "updates are automatically installed on this server every night.\n"
2019-02-05 16:51:27 -08:00
printf "\n"
2020-09-15 14:46:22 -07:00
printf "Read more at https://docs.cloudron.io/security/#os-updates\n"
2024-04-15 13:39:44 +02:00
printf "\n"
2025-01-27 22:02:29 +01:00
printf "Unable to reach the dashboard? Run 'cloudron-support --troubleshoot'.\n"
printf "See https://docs.cloudron.io/troubleshooting/\n"
fi
2019-02-05 16:51:27 -08:00
printf "\nFor help and more information, visit https://forum.cloudron.io\n\n"
2019-02-07 14:07:30 -08:00
printf "**********************************************************************\n"