Skip to content

Commit

Permalink
fix update check
Browse files Browse the repository at this point in the history
  • Loading branch information
m-1-k-3 committed Oct 22, 2024
1 parent 2f2c303 commit 0028dcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions helpers/helpers_emba_dependency_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ check_nvd_db() {
local REMOTE_HASH="${1:-}"
local LOCAL_HASH=""
if [[ -d "${EXT_DIR}"/nvd-json-data-feeds ]] ; then
LOCAL_HASH="$(head -c 8 "${EXT_DIR}"/nvd-json-data-feeds/.git/refs/heads/main)"
LOCAL_HASH="$(head "${EXT_DIR}"/nvd-json-data-feeds/.git/refs/heads/main)"

if [[ "${REMOTE_HASH}" == "${LOCAL_HASH}" ]]; then
echo -e " CVE database version - ${GREEN}ok${NC}"
Expand All @@ -147,7 +147,7 @@ check_epss_db() {
local REMOTE_HASH="${1:-}"
local LOCAL_HASH=""
if [[ -d "${EXT_DIR}"/EPSS-data ]] ; then
LOCAL_HASH="$(head -c 8 "${EXT_DIR}"/EPSS-data/.git/refs/heads/main)"
LOCAL_HASH="$(head "${EXT_DIR}"/EPSS-data/.git/refs/heads/main)"

if [[ "${REMOTE_HASH}" == "${LOCAL_HASH}" ]]; then
echo -e " EPSS database version - ${GREEN}ok${NC}"
Expand All @@ -161,7 +161,8 @@ check_git_hash() {
local REMOTE_HASH="${1:-}"
local LOCAL_HASH=""
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 ; then
LOCAL_HASH="$(git describe --always)"
LOCAL_HASH="$(head .git/refs/heads/master)"
# LOCAL_HASH="$(git describe --always)"

if [[ "${REMOTE_HASH}" == "${LOCAL_HASH}" ]]; then
echo -e " EMBA github version - ${GREEN}ok${NC}"
Expand Down
3 changes: 2 additions & 1 deletion modules/S06_distribution_identification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ S06_distribution_identification()
lSEARCH_FILE="$(safe_echo "${CONFIG}" | cut -d\; -f2)"
# echo "lSEARCH_FILE: $lSEARCH_FILE"
# echo "FIRMWARE_PATH: $FIRMWARE_PATH"
if [[ "${lSEARCH_FILE}" == *"os_release"* ]] || [[ "${lSEARCH_FILE}" == *"lsb-release"* ]]; then
if [[ "${lSEARCH_FILE}" == *"os-release"* ]] || [[ "${lSEARCH_FILE}" == *"lsb-release"* ]]; then
# lets check if we have already a valid debian entry -> if so, we can skip this test
# this usually happens if we have already found an os_release or lsb-release file
# echo "Check for debian - os_release / lsb-release"
if grep -qE "debian_linux:[0-9]+" "${S06_CSV_LOG}"; then
print_output "[*] Already identified Debian Linux version -> skipping further tests now" "no_log"
continue
Expand Down

0 comments on commit 0028dcf

Please sign in to comment.