diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c3b27c..2304a05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Tell sed to follow symlinks * evobackup : exclude tmp directories of LXC containers. * Add a header in `bkctld status` output and improved columns width. +* bkctld-check-setup: compatibility with minifirewall 22.03+ ### Changed diff --git a/lib/bkctld-check-setup b/lib/bkctld-check-setup index d2632a0..95a020b 100755 --- a/lib/bkctld-check-setup +++ b/lib/bkctld-check-setup @@ -29,17 +29,24 @@ fi # Check if the firewall file is sourced minifirewall_config=/etc/default/minifirewall +minifirewall_version=$(/etc/init.d/minifirewall status | head -1 | cut -d ' ' -f 3) if [ -n "${FIREWALL_RULES}" ] \ && [ -r "${FIREWALL_RULES}" ] \ && [ -f "${minifirewall_config}" ]; then - if grep -qE "^(\.|source) ${FIREWALL_RULES}" "${minifirewall_config}"; then + if [ -n "${minifirewall_version}" ] && dpkg --compare-versions "${minifirewall_version}" ge "22.03"; then + # Minifirewall 22.03+ includes files automatically nb_ok=$((nb_ok + 1)) - output="${output}OK - Firewall file \`${FIREWALL_RULES}' is sourced by \`${minifirewall_config}'.\n" + output="${output}OK - Firewall file \`${FIREWALL_RULES}' is present.\n" else - nb_warn=$((nb_warn + 1)) - output="${output}WARNING - Firewall file \`${FIREWALL_RULES}' doesn't seem to be sourced by \`${minifirewall_config}'\n" - [ "${return}" -le 1 ] && return=1 + if grep -qE "^(\.|source) ${FIREWALL_RULES}" "${minifirewall_config}"; then + nb_ok=$((nb_ok + 1)) + output="${output}OK - Firewall file \`${FIREWALL_RULES}' is sourced by \`${minifirewall_config}'.\n" + else + nb_warn=$((nb_warn + 1)) + output="${output}WARNING - Firewall file \`${FIREWALL_RULES}' doesn't seem to be sourced by \`${minifirewall_config}'\n" + [ "${return}" -le 1 ] && return=1 + fi fi fi