From 54ad939b21e797e9a3e311f179ae49a0aba1db22 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Wed, 1 Jan 2025 05:25:33 +0000 Subject: [PATCH] pbr: Makefile bugfixes * remove indentation in postinst/prerm/postrm scripts to fix issues with APK Signed-off-by: Stan Grishin --- net/pbr/Makefile | 146 +++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/net/pbr/Makefile b/net/pbr/Makefile index 1e5ff43f50021..4d6cc98bd7391 100644 --- a/net/pbr/Makefile +++ b/net/pbr/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pbr PKG_VERSION:=1.1.8 -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_LICENSE:=AGPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin @@ -97,94 +97,94 @@ $(call Package/pbr/default/install,$(1)) endef define Package/pbr/postinst - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - chmod -x /etc/init.d/pbr || true - fw4 -q reload || true - chmod +x /etc/init.d/pbr || true - echo -n "Installing rc.d symlink for pbr... " - /etc/init.d/pbr enable && echo "OK" || echo "FAIL" - fi - exit 0 +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + chmod -x /etc/init.d/pbr || true + fw4 -q reload || true + chmod +x /etc/init.d/pbr || true + echo -n "Installing rc.d symlink for pbr... " + /etc/init.d/pbr enable && echo "OK" || echo "FAIL" +fi +exit 0 endef define Package/pbr/prerm - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - uci -q delete firewall.pbr || true - echo -n "Stopping pbr service... " - /etc/init.d/pbr stop quiet >/dev/null 2>&1 && echo "OK" || echo "FAIL" - echo -n "Removing rc.d symlink for pbr... " - /etc/init.d/pbr disable && echo "OK" || echo "FAIL" - fi - exit 0 +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + uci -q delete firewall.pbr || true + echo -n "Stopping pbr service... " + /etc/init.d/pbr stop quiet >/dev/null 2>&1 && echo "OK" || echo "FAIL" + echo -n "Removing rc.d symlink for pbr... " + /etc/init.d/pbr disable && echo "OK" || echo "FAIL" +fi +exit 0 endef define Package/pbr/postrm - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - fw4 -q reload || true - fi - exit 0 +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + fw4 -q reload || true +fi +exit 0 endef define Package/pbr-netifd/postinst - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - chmod -x /etc/init.d/pbr || true - fw4 -q reload || true - chmod +x /etc/init.d/pbr || true - echo -n "Installing rc.d symlink for pbr-netifd... " - /etc/init.d/pbr enable && echo "OK" || echo "FAIL" - fi - exit 0 +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + chmod -x /etc/init.d/pbr || true + fw4 -q reload || true + chmod +x /etc/init.d/pbr || true + echo -n "Installing rc.d symlink for pbr-netifd... " + /etc/init.d/pbr enable && echo "OK" || echo "FAIL" +fi +exit 0 endef define Package/pbr-netifd/prerm - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - uci -q delete firewall.pbr || true - echo -n "Stopping pbr-netifd service... " - /etc/init.d/pbr stop quiet >/dev/null 2>&1 && echo "OK" || echo "FAIL" - echo -n "Removing rc.d symlink for pbr... " - /etc/init.d/pbr disable && echo "OK" || echo "FAIL" - echo -n "Cleaning up /etc/iproute2/rt_tables... " - if sed -i '/pbr_/d' /etc/iproute2/rt_tables; then - echo "OK" - else - echo "FAIL" - fi - echo -n "Cleaning up /etc/config/network... " - uci -q delete 'network.pbr_default' || true - uci -q delete 'network.pbr_default6' || true - uci commit network || true - if sed -i '/ip.table.*pbr_/d' /etc/config/network; then - echo "OK" - else - echo "FAIL" - fi - echo -n "Restarting Network... " - if /etc/init.d/network restart >/dev/null 2>&1; then - echo "OK" - else - echo "FAIL" - fi +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + uci -q delete firewall.pbr || true + echo -n "Stopping pbr-netifd service... " + /etc/init.d/pbr stop quiet >/dev/null 2>&1 && echo "OK" || echo "FAIL" + echo -n "Removing rc.d symlink for pbr... " + /etc/init.d/pbr disable && echo "OK" || echo "FAIL" + echo -n "Cleaning up /etc/iproute2/rt_tables... " + if sed -i '/pbr_/d' /etc/iproute2/rt_tables; then + echo "OK" + else + echo "FAIL" fi - exit 0 + echo -n "Cleaning up /etc/config/network... " + uci -q delete 'network.pbr_default' || true + uci -q delete 'network.pbr_default6' || true + uci commit network || true + if sed -i '/ip.table.*pbr_/d' /etc/config/network; then + echo "OK" + else + echo "FAIL" + fi + echo -n "Restarting Network... " + if /etc/init.d/network restart >/dev/null 2>&1; then + echo "OK" + else + echo "FAIL" + fi +fi +exit 0 endef define Package/pbr-netifd/postrm - #!/bin/sh - # check if we are on real system - if [ -z "$${IPKG_INSTROOT}" ]; then - fw4 -q reload || true - fi - exit 0 +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + fw4 -q reload || true +fi +exit 0 endef $(eval $(call BuildPackage,pbr))