From a8d8450230c38fb1eee1c1ef7d5f14242aa413a6 Mon Sep 17 00:00:00 2001 From: NewUse <7342068+NewUse@users.noreply.github.com> Date: Fri, 4 Oct 2024 11:48:54 +0300 Subject: [PATCH] Update zapret.init add automatic lan name detection --- docs/compile/openwrt/package/zapret/tpws/files/zapret.init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/compile/openwrt/package/zapret/tpws/files/zapret.init b/docs/compile/openwrt/package/zapret/tpws/files/zapret.init index 9c2e3f8..5ad17c4 100644 --- a/docs/compile/openwrt/package/zapret/tpws/files/zapret.init +++ b/docs/compile/openwrt/package/zapret/tpws/files/zapret.init @@ -1,5 +1,7 @@ #!/bin/sh /etc/rc.common +. /lib/functions/network.sh + USE_PROCD=1 # after network START=21 @@ -48,6 +50,7 @@ start_service() local lport local fports local blockq + local ifname config_get opts tpws opts config_get pid tpws pid "tpws.pid" @@ -69,7 +72,8 @@ start_service() procd_append_param command "$opts" 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