letsencrypt-linode/linode-cleanup-hook.sh
2019-04-25 12:48:10 +01:00

10 lines
343 B
Bash

#!/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