diff --git a/net/pbr/Makefile b/net/pbr/Makefile index 6348c9bab..ab931e7cd 100644 --- a/net/pbr/Makefile +++ b/net/pbr/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pbr PKG_VERSION:=1.0.1 -PKG_RELEASE:=10 +PKG_RELEASE:=14 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin @@ -130,8 +130,8 @@ define Package/pbr/prerm # check if we are on real system if [ -z "$${IPKG_INSTROOT}" ]; then uci -q delete firewall.pbr || true - echo "Stopping pbr service... " - /etc/init.d/pbr stop || true + echo -n "Stopping pbr service... " + /etc/init.d/pbr stop && echo "OK" || echo "FAIL" echo -n "Removing rc.d symlink for pbr... " /etc/init.d/pbr disable && echo "OK" || echo "FAIL" fi @@ -151,7 +151,7 @@ define Package/pbr-iptables/postinst #!/bin/sh # check if we are on real system if [ -z "$${IPKG_INSTROOT}" ]; then - echo -n "Installing rc.d symlink for pbr... " + echo -n "Installing rc.d symlink for pbr-iptables... " /etc/init.d/pbr enable && echo "OK" || echo "FAIL" fi exit 0 @@ -162,9 +162,9 @@ define Package/pbr-iptables/prerm # check if we are on real system if [ -z "$${IPKG_INSTROOT}" ]; then uci -q delete firewall.pbr || true - echo "Stopping pbr service... " - /etc/init.d/pbr stop || true - echo -n "Removing rc.d symlink for pbr... " + echo -n "Stopping pbr-iptables service... " + /etc/init.d/pbr stop && echo "OK" || echo "FAIL" + echo -n "Removing rc.d symlink for pbr-iptables... " /etc/init.d/pbr disable && echo "OK" || echo "FAIL" fi exit 0 @@ -174,12 +174,8 @@ define Package/pbr-netifd/postinst #!/bin/sh # check if we are on real system if [ -z "$${IPKG_INSTROOT}" ]; then - echo -n "Installing rc.d symlink for pbr... " + echo -n "Installing rc.d symlink for pbr-netifd... " /etc/init.d/pbr enable && echo "OK" || echo "FAIL" - # echo -n "Installing netifd support for pbr... " - # /etc/init.d/pbr netifd install && echo "OK" || echo "FAIL" - # echo -n "Restarting network... " - # /etc/init.d/network restart && echo "OK" || echo "FAIL" fi exit 0 endef @@ -189,14 +185,10 @@ define Package/pbr-netifd/prerm # check if we are on real system if [ -z "$${IPKG_INSTROOT}" ]; then uci -q delete firewall.pbr || true - echo "Stopping pbr service... " - /etc/init.d/pbr stop || true - # echo -n "Removing netifd support for pbr... " - # /etc/init.d/pbr netifd remove && echo "OK" || echo "FAIL" + echo -n "Stopping pbr-netifd service... " + /etc/init.d/pbr stop && echo "OK" || echo "FAIL" echo -n "Removing rc.d symlink for pbr... " /etc/init.d/pbr disable && echo "OK" || echo "FAIL" - # echo -n "Restarting network... " - # /etc/init.d/network restart && echo "OK" || echo "FAIL" fi exit 0 endef diff --git a/net/pbr/files/etc/init.d/pbr.init b/net/pbr/files/etc/init.d/pbr.init index 481b1d948..e612072c3 100755 --- a/net/pbr/files/etc/init.d/pbr.init +++ b/net/pbr/files/etc/init.d/pbr.init @@ -457,8 +457,8 @@ ips() { case "$command" in add) - ips4 -q -! add "$ipset4" comment "$comment" && ipv4_error=0 - ips6 -q -! add "$ipset6" comment "$comment" && ipv6_error=0 + ips4 -q -! add "$ipset4" ["$param"] comment "$comment" && ipv4_error=0 + ips6 -q -! add "$ipset6" ["$param"] comment "$comment" && ipv6_error=0 ;; add_agh_element) [ -n "$ipv6_enabled" ] || unset ipset6 @@ -1971,6 +1971,11 @@ user_file_process() { fi } +boot() { + ubus -t 30 wait_for network.interface 2>/dev/null + rc_procd start_service 'on_boot' +} + on_firewall_reload() { if [ -z "$(ubus_get_status 'gateways')" ]; then # service is not running, do not start it on firewall reload logger -t "$packageName" "Reload on firewall action aborted: service not running."