Forum Discussion
David_Dalgaard_
Jul 25, 2013Nimbostratus
Script to check for certificate expiration
Hi guys
Most of you have probably been in the situation where a certificate suddenly expired without anyone noticing (or at least no one took proper action). I was in that situation a couple of ...
Héctor_J__Sánc1
Jan 12, 2018Nimbostratus
Hi,
my script also started to fail after upgrading to 12.1, seems that they changed some parts of the output text of "run sys crypto check-cert" and the regex fails.
Change
CERTEXPIRE=$(echo $line | awk -F 'expired on ''{print $2}')
to
CERTEXPIRE=$(echo $line | awk -F 'expire on ' '{print $2}')
(note the missing d) and it should work fine.
also check the following line at the beginning ot the script:
tmsh -c "cd /; run sys crypto check-cert" | grep 'will expire' | awk -F 'in file' '{print $2}' >> "$SCRIPTPATH"expiringcerts.txt
Kind regards.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects