I would like to implement a detection within a script that gives me an answer if the release is at END OF LIFE or still current.
In a nutshell, I call freebsd-update from my script and I need to differentiate between a legitimate error and the error code 1 returned by freebsd-update when the update was successful but the release is not supported anymore:
Ideally I would like to check if the release has passed the end of life date and simply skip it without executing the update.
I don't want to maintain a database with the different versions and their end of life dates.
Any idea on how to do that? Is this logic hardcoded in freebsd-update?
Maybe I could parse the table from this URL: https://www.freebsd.org/security/unsupported/ ?
Edit:
I discovered that a simple curl/grep on the above URL gives me an answer if the release in question is within the unsupported list:
Is there a better way, or is that the way to go?
In a nutshell, I call freebsd-update from my script and I need to differentiate between a legitimate error and the error code 1 returned by freebsd-update when the update was successful but the release is not supported anymore:
Code:
WARNING: FreeBSD 12.1-RELEASE HAS PASSED ITS END-OF-LIFE DATE.
Any security issues discovered after Sun Jan 31 00:00:00 UTC 2021
will not have been corrected.
# echo $?
1
I don't want to maintain a database with the different versions and their end of life dates.
Any idea on how to do that? Is this logic hardcoded in freebsd-update?
Maybe I could parse the table from this URL: https://www.freebsd.org/security/unsupported/ ?
Edit:
I discovered that a simple curl/grep on the above URL gives me an answer if the release in question is within the unsupported list:
Code:
curl https://www.freebsd.org/security/unsupported/ | grep 12.1-RELEASE
[ $? -eq 0 ] && echo "Release is unsupported"
Is there a better way, or is that the way to go?