bash ${SCRIPT} #!/bin/bash # date1=$(date -d now --iso-8601) date2=$(date --date="$(openssl x509 -in /etc/pki/tls/certs/postfix.pem -enddate -noout | cut -d= -f 2)" --iso-8601) start_ts=$(date -d $date1 '+%s') end_ts=$(date -d $date2 '+%s') echo "Statistic.DaysToCertExp: $(( ( end_ts - start_ts )/(60*60*24) ))" exit 0