mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-11 22:16:52 +03:00
fix: add and source network functions, use network_get_ipaddr to obtain LAN listen IP
This commit is contained in:
@@ -12,6 +12,7 @@ check_required_file() {
|
|||||||
PODKOP_LIB="/usr/lib/podkop"
|
PODKOP_LIB="/usr/lib/podkop"
|
||||||
check_required_file /lib/functions.sh
|
check_required_file /lib/functions.sh
|
||||||
check_required_file /lib/config/uci.sh
|
check_required_file /lib/config/uci.sh
|
||||||
|
check_required_file /lib/functions/network.sh
|
||||||
check_required_file "$PODKOP_LIB/constants.sh"
|
check_required_file "$PODKOP_LIB/constants.sh"
|
||||||
check_required_file "$PODKOP_LIB/nft.sh"
|
check_required_file "$PODKOP_LIB/nft.sh"
|
||||||
check_required_file "$PODKOP_LIB/helpers.sh"
|
check_required_file "$PODKOP_LIB/helpers.sh"
|
||||||
@@ -19,8 +20,9 @@ check_required_file "$PODKOP_LIB/sing_box_config_manager.sh"
|
|||||||
check_required_file "$PODKOP_LIB/sing_box_config_facade.sh"
|
check_required_file "$PODKOP_LIB/sing_box_config_facade.sh"
|
||||||
check_required_file "$PODKOP_LIB/logging.sh"
|
check_required_file "$PODKOP_LIB/logging.sh"
|
||||||
check_required_file "$PODKOP_LIB/rulesets.sh"
|
check_required_file "$PODKOP_LIB/rulesets.sh"
|
||||||
. /lib/config/uci.sh
|
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
|
. /lib/config/uci.sh
|
||||||
|
. /lib/functions/network.sh
|
||||||
. "$PODKOP_LIB/constants.sh"
|
. "$PODKOP_LIB/constants.sh"
|
||||||
. "$PODKOP_LIB/nft.sh"
|
. "$PODKOP_LIB/nft.sh"
|
||||||
. "$PODKOP_LIB/helpers.sh"
|
. "$PODKOP_LIB/helpers.sh"
|
||||||
@@ -1512,7 +1514,8 @@ get_service_listen_address() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
service_listen_address="$(uci_get "network" "lan" "ipaddr" | awk '{print $1}' | cut -d'/' -f1)"
|
local interface="lan"
|
||||||
|
network_get_ipaddr service_listen_address "$interface"
|
||||||
|
|
||||||
if [ -z "$service_listen_address" ]; then
|
if [ -z "$service_listen_address" ]; then
|
||||||
log "Failed to determine the listening IP address. Please open an issue to report this problem: https://github.com/itdoginfo/podkop/issues" "error"
|
log "Failed to determine the listening IP address. Please open an issue to report this problem: https://github.com/itdoginfo/podkop/issues" "error"
|
||||||
|
|||||||
Reference in New Issue
Block a user