minifirewall: upstream release 23.02
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good

This commit is contained in:
Jérémy Lecour 2023-02-01 11:27:40 +01:00 committed by Jérémy Lecour
parent d3765ada56
commit 3f0eecc056

View file

@ -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