From b947b26d6b25e2f6b2345d831cb25e5ef72828f0 Mon Sep 17 00:00:00 2001 From: Ailick <277498654@qq.com> Date: Mon, 11 Oct 2021 16:14:23 +0800 Subject: [PATCH 1/2] firewall: add reload config for triggers (#8027) --- package/network/config/firewall/files/firewall.init | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/config/firewall/files/firewall.init b/package/network/config/firewall/files/firewall.init index ee3ed1a28..bcec949af 100755 --- a/package/network/config/firewall/files/firewall.init +++ b/package/network/config/firewall/files/firewall.init @@ -50,6 +50,7 @@ stop_service() { } reload_service() { + reload_config firewall fw3 reload } From 7f7366334cd2fd8d9f6d77b4b8f420ed74c4c9b1 Mon Sep 17 00:00:00 2001 From: Ailick <277498654@qq.com> Date: Mon, 11 Oct 2021 16:15:03 +0800 Subject: [PATCH 2/2] luci-app-turboacc: fix issues #7858 #7970 and more (#8018) * shortcut-fe: Remove unnecessary unloading. * luci-app-turboacc: add fullcone status sync --- .../root/etc/init.d/turboacc | 17 +++++++++--- .../root/etc/init.d/turboacc_fss | 26 +++++++++++++++++++ .../shortcut-fe/files/etc/init.d/shortcut-fe | 2 -- 3 files changed, 39 insertions(+), 6 deletions(-) create mode 100755 package/lean/luci-app-turboacc/root/etc/init.d/turboacc_fss diff --git a/package/lean/luci-app-turboacc/root/etc/init.d/turboacc b/package/lean/luci-app-turboacc/root/etc/init.d/turboacc index c45041d08..b136bb06e 100755 --- a/package/lean/luci-app-turboacc/root/etc/init.d/turboacc +++ b/package/lean/luci-app-turboacc/root/etc/init.d/turboacc @@ -230,10 +230,19 @@ start(){ uci set firewall.@defaults[0].fullcone="${fullcone_nat}" uci commit firewall - [ "${sw_flow}" -ne "1" ] && [ "${sfe_flow}" -eq "1" ] && { - [ "$(have_ecm_init)" = "0" ] && { - /etc/init.d/shortcut-fe enabled || /etc/init.d/shortcut-fe enable - /etc/init.d/shortcut-fe start + /etc/init.d/turboacc_fss start + + [ "${sw_flow}" -ne "1" ] && { + [ "${sfe_flow}" -eq "1" ] && { + [ "$(have_ecm_init)" = "0" ] && { + /etc/init.d/shortcut-fe enabled || /etc/init.d/shortcut-fe enable + /etc/init.d/shortcut-fe start + } + } + [ "${sfe_flow}" -eq "0" ] && [ -e "/etc/init.d/shortcut-fe" ] && [ "$(have_ecm_init)" = "0" ] && \ + /etc/init.d/shortcut-fe enabled && { + /etc/init.d/shortcut-fe stop 2>"/dev/null" + /etc/init.d/shortcut-fe disable } } diff --git a/package/lean/luci-app-turboacc/root/etc/init.d/turboacc_fss b/package/lean/luci-app-turboacc/root/etc/init.d/turboacc_fss new file mode 100755 index 000000000..b48904be1 --- /dev/null +++ b/package/lean/luci-app-turboacc/root/etc/init.d/turboacc_fss @@ -0,0 +1,26 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2021 Ailick <277498654@qq.com> +# For syncing status of firewall full-cone into turboacc. + +START=60 +STOP=10 +SERVICE=turboacc_fss + +USE_PROCD=1 + +service_triggers(){ + procd_add_reload_trigger firewall +} + +start_service(){ + [ ! -e "/etc/init.d/turboacc" ] && stop + uci set turboacc.config.fullcone_nat="$(fullcone_status_get)" && uci commit turboacc +} + +reload_service(){ + start +} + +fullcone_status_get(){ + uci -q get firewall.@defaults[0].fullcone || echo 0 +} diff --git a/package/lean/shortcut-fe/shortcut-fe/files/etc/init.d/shortcut-fe b/package/lean/shortcut-fe/shortcut-fe/files/etc/init.d/shortcut-fe index 88c381ade..786e52df0 100755 --- a/package/lean/shortcut-fe/shortcut-fe/files/etc/init.d/shortcut-fe +++ b/package/lean/shortcut-fe/shortcut-fe/files/etc/init.d/shortcut-fe @@ -46,6 +46,4 @@ stop() { [ -d "/sys/module/shortcut_fe_drv" ] && rmmod shortcut_fe_drv [ -d "/sys/module/shortcut_fe_cm" ] && rmmod shortcut_fe_cm [ -d "/sys/module/fast_classifier" ] && rmmod fast_classifier - [ -d "/sys/module/shortcut_fe_ipv6" ] && rmmod shortcut-fe-ipv6 - [ -d "/sys/module/shortcut_fe" ] && rmmod shortcut-fe }