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 }