cloudron-support: check if whois installed
This commit is contained in:
@@ -177,6 +177,11 @@ function check_hairpin_nat() {
|
||||
}
|
||||
|
||||
function check_expired_domain() {
|
||||
if ! command -v whois &> /dev/null; then
|
||||
echo "Domain expiry check skipped because whois is not installed. Run 'apt install whois' to check"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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}')
|
||||
local -r expdate_secs=$(date -d"$expdate" +%s)
|
||||
|
||||
Reference in New Issue
Block a user