Update zapret.init

add automatic lan name detection
This commit is contained in:
NewUse 2024-10-04 11:48:54 +03:00 committed by GitHub
parent 58e8ce3f44
commit a8d8450230
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,7 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
. /lib/functions/network.sh
USE_PROCD=1 USE_PROCD=1
# after network # after network
START=21 START=21
@ -48,6 +50,7 @@ start_service()
local lport local lport
local fports local fports
local blockq local blockq
local ifname
config_get opts tpws opts config_get opts tpws opts
config_get pid tpws pid "tpws.pid" config_get pid tpws pid "tpws.pid"
@ -69,7 +72,8 @@ start_service()
procd_append_param command "$opts" procd_append_param command "$opts"
procd_set_param pidfile "$PIDDIR/$pid" procd_set_param pidfile "$PIDDIR/$pid"
procd_set_param netdev "br-lan" network_get_device ifname lan
procd_set_param netdev "$ifname"
procd_open_data procd_open_data