[Update] Set iptables-legacy as alternative on Debian systems

master
andryyy 2021-04-07 08:53:39 +02:00
parent 339c8a4315
commit af149079d1
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 5 additions and 0 deletions

View File

@ -485,6 +485,11 @@ while read NAT_ID; do
iptables -t nat -D POSTROUTING $NAT_ID 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) 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_DIRECTORY=update_diffs
DIFF_FILE=${DIFF_DIRECTORY}/diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S") DIFF_FILE=${DIFF_DIRECTORY}/diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S")
mv diff_before_update* ${DIFF_DIRECTORY}/ 2> /dev/null mv diff_before_update* ${DIFF_DIRECTORY}/ 2> /dev/null