From ae5eafff8e1747804fbc5fbb91e60822daebff1d Mon Sep 17 00:00:00 2001 From: WhatTheServer Date: Sat, 24 Apr 2021 19:21:23 -0400 Subject: [PATCH] Update cyberpanel.sh fix inversed conditional and additional check to ensure resolving is done externally --- cyberpanel.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 75e4205d3..135e07ab3 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1784,9 +1784,8 @@ if [[ "$Server_Country" = "CN" ]] ; then Post_Install_CN_Replacement fi -# If valid hostname that resolves where we can issue an ssl we will create the hostname as a website so we can issue the SSL and do our first login without SSL warnings or exceptions needed. -#HostName=$(hostname --fqdn); [ -z "$(dig +short "$HostName")" ] && echo "$HostName resolves to valid IP. Setting up hostname SSL" && cyberpanel createWebsite --package Default --owner admin --domainName $(hostname --fqdn) --email root@localhost --php 7.4 && cyberpanel hostNameSSL --domainName $(hostname --fqdn) - +# If valid hostname is set that resolves externally we can issue an ssl. This will create the hostname as a website so we can issue the SSL and do our first login without SSL warnings or exceptions needed. +HostName=$(hostname --fqdn); [ -n "$(dig @1.1.1.1 +short "$HostName")" ] && echo "$HostName resolves to valid IP. Setting up hostname SSL" && cyberpanel createWebsite --package Default --owner admin --domainName $(hostname --fqdn) --email root@localhost --php 7.4 && cyberpanel hostNameSSL --domainName $(hostname --fqdn) }