From af149079d1ad02656f177ca98f62cf8b69fa5db7 Mon Sep 17 00:00:00 2001 From: andryyy Date: Wed, 7 Apr 2021 08:53:39 +0200 Subject: [PATCH] [Update] Set iptables-legacy as alternative on Debian systems --- update.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/update.sh b/update.sh index d5114c9f..3e60bc6a 100755 --- a/update.sh +++ b/update.sh @@ -485,6 +485,11 @@ while read NAT_ID; do iptables -t nat -D POSTROUTING $NAT_ID done < <(iptables -L -vn -t nat --line-numbers | grep $IPV4_NETWORK | grep -E 'MASQUERADE.*all' | grep -v ${MAILCOW_BRIDGE} | cut -d' ' -f1) +echo -e "\e[32mChecking for iptables-legacy...\e[0m" +if update-alternatives --list iptables 2> /dev/null | grep -q /usr/sbin/iptables-legacy; then + update-alternatives --set iptables /usr/sbin/iptables-legacy +fi + DIFF_DIRECTORY=update_diffs DIFF_FILE=${DIFF_DIRECTORY}/diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S") mv diff_before_update* ${DIFF_DIRECTORY}/ 2> /dev/null