cloudron-support: whois may not have expiry info

This commit is contained in:
Girish Ramakrishnan
2023-12-14 17:12:07 +01:00
parent 8b5afaa12c
commit 4374124985
+5
View File
@@ -184,6 +184,11 @@ function check_expired_domain() {
local -r dashboard_domain=$(mysql -NB -uroot -ppassword -e "SELECT value FROM box.settings WHERE name='dashboard_domain'" 2>/dev/null)
local -r expdate=$(whois ${dashboard_domain} | egrep -i 'Expiration Date:|Expires on|Expiry Date:' | head -1 | awk '{print $NF}')
if [[ -z "${expdate}" ]]; then
echo "Domain expiry check skipped because whois does not have this information"
exit 0
fi
local -r expdate_secs=$(date -d"$expdate" +%s)
local -r curdate_secs="$(date +%s)"