Brought it back
This commit is contained in:
parent
ac50c87b89
commit
9df9925c72
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.api-key
|
@ -12,3 +12,17 @@ if [[ hello -ne 200 ]]; then
|
||||
echo "token not valid, exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo $API_KEY > .api-key
|
||||
|
||||
[ ! which at ] && sudo apt install at
|
||||
|
||||
date=$(curl -sH "x-ssh-auth: $API_KEY" $API_HOST/time | grep -o '"expireDate":"[^"]*' | grep -o '[^"]*$')
|
||||
|
||||
echo atd >> /start.sh
|
||||
atd
|
||||
|
||||
at -t $(date -d $date +'%Y%m%d%H%M') -f /root/container-expire-notifs/notify.sh
|
||||
|
||||
notif "Container expiration notifications brought back successfully!"
|
||||
notif "**WRNING**: If your conainer is off you may not receive the reminder"
|
||||
|
7
notify.sh
Executable file
7
notify.sh
Executable file
@ -0,0 +1,7 @@
|
||||
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 '[^"]*$')
|
||||
at -t $(date -d $date +'%Y%m%d%H%M') -f /root/container-expire-notifs/notify.sh
|
Loading…
Reference in New Issue
Block a user