diff --git a/iptables.spec b/iptables.spec index fea32a8..6e78faf 100644 --- a/iptables.spec +++ b/iptables.spec @@ -191,7 +191,9 @@ update-alternatives \ --slave "%_sbindir/ip6tables-save" ip6tables-save "%_sbindir/xtables-legacy-multi" %postun -update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" +if test "$1" = 0; then + update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" +fi %post backend-nft update-alternatives \ @@ -209,9 +211,11 @@ update-alternatives --install "%_sbindir/ebtables" ebtables "%_sbindir/xtables-n --slave "%_sbindir/ebtables-save" ebtables-save "%_sbindir/xtables-nft-multi" %postun backend-nft -update-alternatives --remove iptables "%_sbindir/xtables-nft-multi" -update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" -update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" +if test "$1" = 0; then + update-alternatives --remove iptables "%_sbindir/xtables-nft-multi" + update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" + update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" +fi %post -n libipq0 -p /sbin/ldconfig %postun -n libipq0 -p /sbin/ldconfig