From b84bcf899bb57815f586041ab5d74ef1f938718a Mon Sep 17 00:00:00 2001 From: xh Date: Tue, 30 Jul 2024 11:25:51 +0000 Subject: [PATCH] fix ebtables-restore --noflush failed when ebtables is uninstall --- ebtables.spec | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ebtables.spec b/ebtables.spec index faccb90..e7a2aa5 100644 --- a/ebtables.spec +++ b/ebtables.spec @@ -1,7 +1,7 @@ Name: ebtables Version: 2.0.11 -Release: 8 +Release: 9 Summary: A filtering tool for a Linux-based bridging firewall License: GPLv2+ URL: http://ebtables.sourceforge.net/ @@ -85,6 +85,19 @@ fi if [ $1 -eq 0 ]; then %{_sbindir}/update-alternatives --remove \ ebtables %{_sbindir}/ebtables-legacy + if [ -e /usr/sbin/iptables-nft ]; then + pfx=%{_sbindir}/ebtables + manpfx=%{_mandir}/man8/ebtables + %{_sbindir}/update-alternatives --install \ + $pfx ebtables $pfx-nft 10 \ + --slave $pfx-save ebtables-save $pfx-nft-save \ + --slave $pfx-restore ebtables-restore $pfx-nft-restore \ + --slave $manpfx.8.gz ebtables-man $manpfx-nft.8.gz + systemctl status firewalld 2>/dev/null | grep -w "running" > /dev/null + if [ $? -eq 0 ];then + systemctl restart firewalld || : + fi + fi fi %files @@ -108,6 +121,12 @@ fi %doc %{_mandir}/man8/ebtables-legacy.8* %changelog +* Tue Jul 30 2024 xinghe - 2.0.11-9 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix ebtables-restore --noflush failed when ebtables is uninstall + * Thu Aug 31 2023 lifeifei - 2.0.11-8 - Type:bugfix - ID:NA