Initial lookup with awk corrected

This commit is contained in:
Michael Boelen 2019-03-04 12:13:47 +01:00
parent e0b93ed0cc
commit 9d8b12e0f8
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
1 changed files with 2 additions and 2 deletions

View File

@ -515,8 +515,8 @@
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}"
# Does not work on FreeBSD: EOL_DATE=$(awk -v value="${FIND}" -F: '{if ($1=="os" && $2 ~ value){print $3}}' ${DBDIR}/software-eol.db | head -n 1) EOL_DATE=$(awk -v value="${FIND}" -F: '{if ($1=="os" && value ~ $2){print $3}}' ${DBDIR}/software-eol.db | head -n 1)
EOL_DATE=$(grep "os:${FIND}" ${DBDIR}/software-eol.db | awk -F: '{print $3}' | head -n 1) #EOL_DATE=$(grep "os:${FIND}" ${DBDIR}/software-eol.db | awk -F: '{print $3}' | head -n 1)
if [ ! -z "${EOL_DATE}" ]; then if [ ! -z "${EOL_DATE}" ]; then
NOW=$(date "+%s") NOW=$(date "+%s")
FIND=$(date "+%s" --date=${EOL_DATE}) FIND=$(date "+%s" --date=${EOL_DATE})