I want to update a custom text sensor with the expiration date of my free Lets Encrypt certificate on my Synology.
So far I've been able to find and store the date in a Shell Variable using Bash but updating the text sensor is not working (in various use of brackets and parenthises)..
The code I use is the following:
Code: Select all
export expdate=$(openssl x509 -noout -dates -in /usr/syno/etc/certificate/_archive/******/cert.pem | grep 'notAfter=' | sed 's/.........//')
curl -s "http://domoipaddress:8080/json.htm?param=udevice&username=******=&password=******==&type=command&idx=365&nvalue=0&svalue='$expdate'"
What's going wrong?