diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2019-03-05 21:31:36 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2019-03-05 21:31:36 +0300 |
commit | 8888b01dcd5cb93fa3d4d15d79a568d57841ffbc (patch) | |
tree | 5f5926d10d77d7b531294f236d026a8eacbf2735 | |
parent | 32fc4a01b0fc9ebfdf23b7d08bee85dc4f57c1bf (diff) |
Store date and timestamp for EOL
-rw-r--r-- | include/osdetection | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/osdetection b/include/osdetection index 069167bb..5ab80293 100644 --- a/include/osdetection +++ b/include/osdetection @@ -512,14 +512,16 @@ # Check if this OS is end-of-life EOL=255 EOL_DATE="" + EOL_TIMESTAMP=0 if [ ! -z "${OS_VERSION}" ]; then if [ -f "${DBDIR}/software-eol.db" ]; then FIND="${OS_FULLNAME}" - EOL_DATE=$(awk -v value="${FIND}" -F: '{if ($1=="os" && value ~ $2){print $4}}' ${DBDIR}/software-eol.db | head -n 1) - if [ ! -z "${EOL_DATE}" ]; then + EOL_TIMESTAMP=$(awk -v value="${FIND}" -F: '{if ($1=="os" && value ~ $2){print $4}}' ${DBDIR}/software-eol.db | head -n 1) + 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") if [ ! -z "${NOW}" ]; then - if [ ${NOW} -gt ${EOL_DATE} ]; then + if [ ${NOW} -gt ${EOL_TIMESTAMP} ]; then EOL=1 else EOL=0 |