mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 11:29:12 +02:00
New fixed domain_expiration_date.sh
This commit is contained in:
parent
7d4e95f3cb
commit
d619386cd4
22
pandora_plugins/Internet Domains and WHOIS/domain_expiration_date.sh
Executable file
22
pandora_plugins/Internet Domains and WHOIS/domain_expiration_date.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]
|
||||||
|
then
|
||||||
|
echo
|
||||||
|
echo "Usage: domain_expiration_date.sh <domain_name>"
|
||||||
|
echo "Returns the number of days to expiration date"
|
||||||
|
echo
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
domain=$1
|
||||||
|
|
||||||
|
# Calculate days until expiration
|
||||||
|
expiration=`whois $domain |grep "Expiry Date:"| awk -F"Date:" '{print $2}'|cut -f 1`
|
||||||
|
expseconds=`date +%s --date="$expiration"`
|
||||||
|
nowseconds=`date +%s`
|
||||||
|
((diffseconds=expseconds-nowseconds))
|
||||||
|
expdays=$((diffseconds/86400))
|
||||||
|
|
||||||
|
echo $expdays
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user