I am trying to a write a bash script which would take out put of openssl -enddate command and compare it with dateutil.ddiff now and wanted to know how many days are remaining.
SSLDATE=`openssl x509 -noout -in wild.crt -enddate | sed -e 's/notAfter=//g' | awk '{print $4"-""03""-"$2}'`
Now I have installed dateutils package which provides me this facility. However I am not getting how do I calculate the with $SSLDATE - $now?
Plus is there a way since openssl -enddate gives Month in alphabet format while dateutils accepts in numeric format
Any idea how to achieve it? For example
dateutils.ddiff 2021-04-12 2022-04-15 -f '%dd'
**368d**
Or is there any other alternative for this?