container-expire-notifs/notify.sh

8 lines
445 B
Bash
Raw Normal View History

2024-06-19 04:35:24 -04:00
API_HOST="https://api.ssh.surf"
API_KEY=$(cat .api-key)
notif "Hello, your container at SSH.SURF has hit its expire date, if not extended before 6PM EST the container will be removed automatically. Use /extend to gain another 7 days."
date=$(curl -sH "x-ssh-auth: $API_KEY" $API_HOST/time | grep -o '"expireDate":"[^"]*' | grep -o '[^"]*$')
2024-07-25 00:54:26 -04:00
at -t $(date -d $date +'%Y%m%d%H%M' -d "$end_date+7 days") -f /root/container-expire-notifs/notify.sh