v1.1.6-test

~新增自定义本机host地址的功能(7-6-8)
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入配置文件失败的bug
This commit is contained in:
juewuy
2021-03-19 17:55:20 +08:00
parent 6129b69588
commit 4d7bd92381
2 changed files with 25 additions and 4 deletions

View File

@@ -90,7 +90,7 @@ mark_time(){
echo start_time=$start_time >> $clashdir/mark
}
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=$(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|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"
}