This commit is contained in:
lean 2021-10-11 17:12:11 +08:00
commit dd9f6db1e8
4 changed files with 40 additions and 6 deletions

View File

@ -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
}
}

View File

@ -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
}

View File

@ -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
}

View File

@ -50,6 +50,7 @@ stop_service() {
}
reload_service() {
reload_config firewall
fw3 reload
}