diff options
-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 |