From bf484cbcf25988a81e82c2fa55913c2ae4d4c294 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 25 Feb 2022 08:24:28 +0100 Subject: [PATCH] firmware: check repository and plugin state in health audit More often than not this is useful to know. --- src/opnsense/scripts/firmware/health.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/opnsense/scripts/firmware/health.sh b/src/opnsense/scripts/firmware/health.sh index a2db19b5a..67d617ea1 100755 --- a/src/opnsense/scripts/firmware/health.sh +++ b/src/opnsense/scripts/firmware/health.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2017-2021 Franco Fichtner +# Copyright (C) 2017-2022 Franco Fichtner # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -217,6 +217,17 @@ echo "Currently running $(opnsense-version) at $(date)" >> ${LOCKFILE} set_check kernel set_check base +echo ">>> Check installed repositories" | ${TEE} ${LOCKFILE} +(opnsense-verify -l 2>&1) | ${TEE} ${LOCKFILE} + +echo ">>> Check installed plugins" | ${TEE} ${LOCKFILE} +PLUGINS=$(pkg query -g '%n %v' 'os-*' 2>&1) +if [ -n "${PLUGINS}" ]; then + (echo "${PLUGINS}") | ${TEE} ${LOCKFILE} +else + echo "No plugins found." | ${TEE} ${LOCKFILE} +fi + echo ">>> Check for missing package dependencies" | ${TEE} ${LOCKFILE} (pkg check -dan 2>&1) | ${TEE} ${LOCKFILE}