Added the cleanup hook script

This commit is contained in:
Andy Heathershaw 2019-04-25 12:48:10 +01:00
parent f14db344ba
commit 596da5f694

9
linode-cleanup-hook.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#echo $CERTBOT_DOMAIN
#echo $CERTBOT_VALIDATION
#echo $CERTBOT_TOKEN
DOMAIN_ID=`linode-cli domains list|grep $CERTBOT_DOMAIN|awk -F' ' '{print $2}'`
RECORD_ID=`linode-cli domains records-list $DOMAIN_ID|grep _acme-challenge|grep $CERTBOT_VALIDATION|awk -F' ' '{print $2}'`
linode-cli domains records-delete $DOMAIN_ID $RECORD_ID