remove firewall.user code in init

This commit is contained in:
bolvan 2019-05-06 12:36:16 +03:00
parent 757ceedd18
commit b410ef2e35

View File

@ -62,25 +62,6 @@ TPWS_OPT_BASE_HTTP="--port=$TPPORT_HTTP $TPWS_OPT_BASE"
TPWS_OPT_BASE_HTTPS="--port=$TPPORT_HTTPS $TPWS_OPT_BASE" TPWS_OPT_BASE_HTTPS="--port=$TPPORT_HTTPS $TPWS_OPT_BASE"
# must execute /etc/firewall.user on every firewall reload
set_firewall_user_reload() {
i=0
while true
do
path=$(uci -q get firewall.@include[$i].path)
[ -n "$path" ] || break
[ "$path" == "/etc/firewall.user" ] && {
reload=$(uci -q get firewall.@include[$i].reload)
[ "$reload" = "1" ] || {
echo Setting 'reload' call option to /etc/firewall.user
uci set firewall.@include[$i].reload=1
uci commit firewall
}
}
i=$((i+1))
done
}
run_daemon() run_daemon()
{ {
# $1 - daemon string id or number. can use 1,2,3,... # $1 - daemon string id or number. can use 1,2,3,...
@ -103,8 +84,6 @@ create_ipset()
start_service() { start_service() {
set_firewall_user_reload
case "${MODE}" in case "${MODE}" in
tpws_hostlist) tpws_hostlist)
run_daemon 1 $TPWS "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP --hostlist=$TPWS_HOSTLIST" run_daemon 1 $TPWS "$TPWS_OPT_BASE_HTTP $TPWS_OPT_HTTP --hostlist=$TPWS_HOSTLIST"