Added additional boundary checking to grep commands

This commit is contained in:
Andy Heathershaw 2019-05-03 22:28:21 +01:00
parent 8bfdc23809
commit 5ec4620664

View File

@ -3,7 +3,7 @@
#echo $CERTBOT_VALIDATION #echo $CERTBOT_VALIDATION
#echo $CERTBOT_TOKEN #echo $CERTBOT_TOKEN
DOMAIN_ID=`linode-cli domains list|grep $CERTBOT_DOMAIN|awk -F' ' '{print $2}'` DOMAIN_ID=`linode-cli domains list|grep -e "\s$CERTBOT_DOMAIN\s"|awk -F' ' '{print $2}'`
RECORD_ID=`linode-cli domains records-list $DOMAIN_ID|grep _acme-challenge|grep $CERTBOT_VALIDATION|awk -F' ' '{print $2}'` RECORD_ID=`linode-cli domains records-list $DOMAIN_ID|grep -e "\s_acme-challenge\s"|grep -e "\s$CERTBOT_VALIDATION\s"|awk -F' ' '{print $2}'`
linode-cli domains records-delete $DOMAIN_ID $RECORD_ID linode-cli domains records-delete $DOMAIN_ID $RECORD_ID