From 6129b6958878b9d74a63cd59fd86f92cbcad29e3 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sat, 13 Mar 2021 19:28:32 +0800 Subject: [PATCH] =?UTF-8?q?v1.1.6-test=20~=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=83=85=E5=86=B5=E4=B8=8B=E6=A3=80=E6=B5=8B=E6=9C=AC?= =?UTF-8?q?=E6=9C=BAhost=E5=A4=B1=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/clash.sh | 2 +- scripts/start.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/clash.sh b/scripts/clash.sh index 4b9d5ae..f5fb218 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -28,7 +28,7 @@ getconfig(){ [ ! -f $clashdir/mac ] && touch $clashdir/mac #获取本机host地址 host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';) - [ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '192.|10.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) + [ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '\ 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) [ -z "$host" ] && host=127.0.0.1 #dashboard目录位置 [ -d $clashdir/ui ] && dbdir=$clashdir/ui && hostdir=":$db_port/ui" diff --git a/scripts/start.sh b/scripts/start.sh index a41270f..552ad3f 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -91,8 +91,8 @@ mark_time(){ } gethost(){ host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';) - [ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '^1(92|0)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) - [ -n "$host" ] && lanhost="-s $(echo $host | grep -oE '^1(92|0)\.')0.0.0/8" + [ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '\ 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) + [ -n "$host" ] && lanhost="-s $(echo $host | grep -oE '^1(92|0|72)\.')0.0.0/8" } #配置文件相关 getyaml(){