From 290884d59296ab01a43f8eb2c8254c6cae435c84 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 13 Mar 2020 21:12:43 +0800 Subject: [PATCH] OpenClash: sync with upstream source --- .../files/usr/share/openclash/clash_version.sh | 2 +- .../files/usr/share/openclash/openclash_core.sh | 2 +- .../files/usr/share/openclash/openclash_game_rule.sh | 2 +- .../files/usr/share/openclash/openclash_rule.sh | 5 +++-- .../files/usr/share/openclash/openclash_update.sh | 2 +- .../files/usr/share/openclash/openclash_version.sh | 5 +++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/clash_version.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/clash_version.sh index 28d888a7bb..da1c5ee362 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/clash_version.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/clash_version.sh @@ -5,7 +5,7 @@ LAST_VER=$(sed -n 1p "$LAST_OPVER" 2>/dev/null |awk -F '-' '{print $1$2}' 2>/dev CLASH_VERF=$(/etc/openclash/clash -v 2>/dev/null) CLASH_VER=$(echo "$CLASH_VERF" 2>/dev/null |awk -F ' ' '{print $2}' 2>/dev/null |awk -F '-' '{print $1$2}' 2>/dev/null |awk -F '.' '{print $2$3}' 2>/dev/null) HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null) -PROXY_ADDR="127.0.0.1" +PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) if [ -s "/tmp/openclash.auth" ]; then PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null) diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_core.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_core.sh index c6d11628c3..f4e7e14150 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_core.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_core.sh @@ -8,7 +8,7 @@ LOGTIME=$(date "+%Y-%m-%d %H:%M:%S") LOG_FILE="/tmp/openclash.log" CPU_MODEL=$(uci get openclash.config.core_version 2>/dev/null) HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null) -PROXY_ADDR="127.0.0.1" +PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) if [ -s "/tmp/openclash.auth" ]; then PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null) fi diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_game_rule.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_game_rule.sh index d0d53f4fe3..279020ed2c 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_game_rule.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_game_rule.sh @@ -11,7 +11,7 @@ LOGTIME=$(date "+%Y-%m-%d %H:%M:%S") LOG_FILE="/tmp/openclash.log" HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null) - PROXY_ADDR="127.0.0.1" + PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) if [ -s "/tmp/openclash.auth" ]; then PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null) fi diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_rule.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_rule.sh index 1dea76188a..0e97415725 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_rule.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_rule.sh @@ -5,7 +5,8 @@ echo "开始获取使用中的第三方规则名称..." >$START_LOG RUlE_SOURCE=$(uci get openclash.config.rule_source 2>/dev/null) HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null) - PROXY_ADDR="127.0.0.1" + PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) + if [ -s "/tmp/openclash.auth" ]; then PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null) fi @@ -64,4 +65,4 @@ sleep 10 echo "" >$START_LOG fi - sed ':label;N;s/\n//;b label' /etc/openclash/lhie1.yaml \ No newline at end of file + sed ':label;N;s/\n//;b label' /etc/openclash/lhie1.yaml diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_update.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_update.sh index d07e9205e0..3c181ff67e 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_update.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_update.sh @@ -9,7 +9,7 @@ LOG_FILE="/tmp/openclash.log" LAST_OPVER="/tmp/openclash_last_version" LAST_VER=$(sed -n 1p "$LAST_OPVER" 2>/dev/null |sed "s/^v//g") HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null) -PROXY_ADDR="127.0.0.1" +PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) if [ -s "/tmp/openclash.auth" ]; then PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null) fi diff --git a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_version.sh b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_version.sh index 709018feb4..d0acb34cce 100755 --- a/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_version.sh +++ b/package/ctcgfw/luci-app-openclash/files/usr/share/openclash/openclash_version.sh @@ -4,7 +4,8 @@ LAST_OPVER="/tmp/openclash_last_version" OP_CV=$(sed -n 1p /etc/openclash/openclash_version 2>/dev/null |awk -F '-' '{print $1}' |awk -F '.' '{print $2$3}') OP_LV=$(sed -n 1p $LAST_OPVER 2>/dev/null |awk -F '-' '{print $1}' |awk -F '.' '{print $2$3}') HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null) -PROXY_ADDR="127.0.0.1" +PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null) + if [ -s "/tmp/openclash.auth" ]; then PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null) fi @@ -32,4 +33,4 @@ elif [ "$OP_CV" -ge "$OP_LV" ]; then echo "CheckTime:$CKTIME" >>$LAST_OPVER elif [ "$OP_CV" -lt "$OP_LV" ]; then return 2 -fi \ No newline at end of file +fi