diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh b/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh index f5d9a31503..3f46783d5f 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh @@ -46,7 +46,7 @@ lan_interface_name=$(uci -q get openclash.config.lan_interface_name || echo "0") if [ "$lan_interface_name" = "0" ]; then lan_ip=$(uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null || ip address show $(uci -q -p /tmp/state get network.lan.ifname || uci -q -p /tmp/state get network.lan.device) | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1) else - lan_ip=$(ip address show $(uci -q -p $lan_interface_name) | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}') + lan_ip=$(ip address show $lan_interface_name | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}') fi dnsmasq_default_resolvfile=$(uci -q get openclash.config.default_resolvfile) diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_history_get.sh b/luci-app-openclash/root/usr/share/openclash/openclash_history_get.sh index 44efafded0..9ec358dd8e 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_history_get.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_history_get.sh @@ -18,7 +18,7 @@ close_all_conection() { if [ "$lan_interface_name" = "0" ]; then LAN_IP=$(uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null || ip address show $(uci -q -p /tmp/state get network.lan.ifname || uci -q -p /tmp/state get network.lan.device) | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1) else - LAN_IP=$(ip address show $(uci -q -p $lan_interface_name) | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}') + LAN_IP=$(ip address show $lan_interface_name | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}') fi PORT=$(uci -q get openclash.config.cn_port) curl -m 2 -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X DELETE http://"$LAN_IP":"$PORT"/connections >/dev/null 2>&1