mirror of https://github.com/CISOfy/lynis.git
Store date and timestamp for EOL
This commit is contained in:
parent
32fc4a01b0
commit
8888b01dcd
|
@ -512,14 +512,16 @@
|
||||||
# Check if this OS is end-of-life
|
# Check if this OS is end-of-life
|
||||||
EOL=255
|
EOL=255
|
||||||
EOL_DATE=""
|
EOL_DATE=""
|
||||||
|
EOL_TIMESTAMP=0
|
||||||
if [ ! -z "${OS_VERSION}" ]; then
|
if [ ! -z "${OS_VERSION}" ]; then
|
||||||
if [ -f "${DBDIR}/software-eol.db" ]; then
|
if [ -f "${DBDIR}/software-eol.db" ]; then
|
||||||
FIND="${OS_FULLNAME}"
|
FIND="${OS_FULLNAME}"
|
||||||
EOL_DATE=$(awk -v value="${FIND}" -F: '{if ($1=="os" && value ~ $2){print $4}}' ${DBDIR}/software-eol.db | head -n 1)
|
EOL_TIMESTAMP=$(awk -v value="${FIND}" -F: '{if ($1=="os" && value ~ $2){print $4}}' ${DBDIR}/software-eol.db | head -n 1)
|
||||||
if [ ! -z "${EOL_DATE}" ]; then
|
if [ ! -z "${EOL_TIMESTAMP}" ]; then
|
||||||
|
EOL_DATE=$(awk -v value="${FIND}" -F: '{if ($1=="os" && value ~ $2){print $3}}' ${DBDIR}/software-eol.db | head -n 1)
|
||||||
NOW=$(date "+%s")
|
NOW=$(date "+%s")
|
||||||
if [ ! -z "${NOW}" ]; then
|
if [ ! -z "${NOW}" ]; then
|
||||||
if [ ${NOW} -gt ${EOL_DATE} ]; then
|
if [ ${NOW} -gt ${EOL_TIMESTAMP} ]; then
|
||||||
EOL=1
|
EOL=1
|
||||||
else
|
else
|
||||||
EOL=0
|
EOL=0
|
||||||
|
|
Loading…
Reference in New Issue