Um Domains zu Monitoren gibt es mehrere Möglichkeiten. Die Einfachste ist mit Bash Code. Ich habe dazu ein einfaches Skript programmiert, welches aus den whois ganz einfach den Expire Day herausfischt und danach die verbliebenen Tage errechnet.
Sollten die Domain in weniger als 15 Tagen ablaufen, wird das vermerkt.
#!/bin/bash
#set -x
# list domains
domains=(
"example.com"
"example.org"
)
current_date=$(date +%Y-%m-%d)
current_epoch=`date '+%s'`
# check domains
for domain in "${domains[@]}"; do
# Get the expiration date
expdate=$(whois $domain | grep -iE 'expir.*date|expir.*on' | head -1 | grep -oE '[^ ]+$')
# Turn it into seconds (easier to compute with)
expdate=$(date -d"$expdate" +%s)
# Day when the domain expires
expdate_day=$(date -d@$expdate +%d.%m.%Y)
# Get the current date in seconds
curdate=$(date +%s)
# Print the difference in days
days=$(((expdate-curdate)/86400))
if [ $days -lt 15 ]; then
printf "HEY! $domain is going to expire in the next $days days! (On the: $expdate_day)\n"
printf "WHOIS: https://who.is/whois/$domain \n\n"
fi;
# sleep for cooldown on whois command
sleep 10
done
Um es zu verwenden, speicher das kleine Script an einem sicheren Ort ab. Danach mach es noch ausführbar:
chmod +x /path/to/domain-monitor.sh
Am Ende kann das Skript kann dann ganz einfach über ein Cronjob ausgeführt werden.
5 4 * * * root /bin/bash /path/to/domain-monitor.sh
Wichtig: Stelle sicher, dass der Output vom Cron dir via E-Mail zugesendet wird, sonst erhältst du nie eine Nachricht!