From 3f0eecc0569efafd0a842df9296c793f2c2b5b5a Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Wed, 1 Feb 2023 11:27:40 +0100 Subject: [PATCH] minifirewall: upstream release 23.02 --- minifirewall/files/minifirewall | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/minifirewall/files/minifirewall b/minifirewall/files/minifirewall index 4beeaf7d..3922e889 100755 --- a/minifirewall/files/minifirewall +++ b/minifirewall/files/minifirewall @@ -29,7 +29,7 @@ # Description: Firewall designed for standalone server ### END INIT INFO -VERSION="22.06" +VERSION="23.02" NAME="minifirewall" # shellcheck disable=SC2034 @@ -147,6 +147,9 @@ fi # } ## Beware that commands executed from included files are not modified by this trick. +remove_colors() { + sed -r 's/\x1B\[(;?[0-9]{1,3})+[mGK]//g' +} syslog_info() { if [ -x "${LOGGER_BIN}" ]; then ${LOGGER_BIN} -t "${NAME}" -p daemon.info "$1" @@ -268,9 +271,9 @@ check_unpersisted_state() { elif [ -z "${diff_bin}" ]; then printf "${YELLOW}skip state comparison (Can't find diff command)${RESET}\n" >&2 else - # store current state + # store current state (without colors) mkdir -p "$(dirname "${STATE_FILE_CURRENT}")" - status_without_numbers > "${STATE_FILE_CURRENT}" + status_without_numbers | remove_colors > "${STATE_FILE_CURRENT}" # clean previous diff file rm -f "${STATE_FILE_DIFF}" @@ -310,9 +313,9 @@ report_state_changes() { check_unpersisted_state fi - # Then reset the known state + # Then reset the known state (without colors) mkdir -p "$(dirname "${STATE_FILE_LATEST}")" - status_without_numbers > "${STATE_FILE_LATEST}" + status_without_numbers | remove_colors > "${STATE_FILE_LATEST}" # But if there is a previous known state # let's compare with the new known state @@ -920,8 +923,9 @@ stop() { printf "${BLUE}flushing all rules and accepting everything${RESET}\n" + # Save previous state (without colors) mkdir -p "$(dirname "${STATE_FILE_PREVIOUS}")" - status_without_numbers > "${STATE_FILE_PREVIOUS}" + status_without_numbers | remove_colors > "${STATE_FILE_PREVIOUS}" # Delete all rules ${IPT} -F INPUT