Compare commits

..

No commits in common. "0c119aaba5f691cd8d5cc6b8752c91713ffc6d29" and "1a1fb3dd291a6a03130aeb3b7928be7ff429d36a" have entirely different histories.

9 changed files with 17 additions and 22 deletions

View File

@ -19,8 +19,6 @@
- 当前在RHEL系列和Debian系列Linux系统中测试过其他系列可能需要适当修改脚本。
- 支持 x86_64/aarch64 平台
> **注意**:当你在使用此项目时,遇到任何无法独自解决的问题请优先前往 [Issues](https://github.com/wanhebin/clash-for-linux/issues) 寻找解决方法。由于空闲时间有限后续将不再对Issues中 “已经解答”、“已有解决方案” 的问题进行重复性的回答。
<br>
# 使用教程

Binary file not shown.

1
bin/clash-linux-amd64 Symbolic link
View File

@ -0,0 +1 @@
clash-linux-amd64-v1.13.0

BIN
bin/clash-linux-amd64-v1.13.0 Executable file

Binary file not shown.

Binary file not shown.

1
bin/clash-linux-arm64 Symbolic link
View File

@ -0,0 +1 @@
clash-linux-arm64-v1.14.0

BIN
bin/clash-linux-arm64-v1.14.0 Executable file

Binary file not shown.

Binary file not shown.

1
bin/clash-linux-armv7 Symbolic link
View File

@ -0,0 +1 @@
clash-linux-armv7-v1.15.1

BIN
bin/clash-linux-armv7-v1.15.1 Executable file

Binary file not shown.

View File

@ -22,9 +22,10 @@ else
else
echo "解码后的内容不符合clash标准尝试将其转换为标准格式"
${Server_Dir}/tools/subconverter/subconverter -g &>> ${Server_Dir}/logs/subconverter.log
converted_file=${Server_Dir}/temp/clash_config.yaml
converted_content=$(cat ${Server_Dir}/temp/clash_config.yaml)
# 判断转换后的内容是否符合clash配置文件标准
if awk '/^proxies:/{p=1} /^proxy-groups:/{g=1} /^rules:/{r=1} p&&g&&r{exit} END{if(p&&g&&r) exit 0; else exit 1}' $converted_file; then
#if cat ./temp/clash_config.yaml | jq 'has("proxies") and has("proxy-groups") and has("rules")' 2>/dev/null; then
if echo "$converted_content" | awk '/^proxies:/{p=1} /^proxy-groups:/{g=1} /^rules:/{r=1} p&&g&&r{exit} END{if(p&&g&&r) exit 0; else exit 1}'; then
echo "配置文件已成功转换成clash标准格式"
else
echo "配置文件转换标准格式失败"

View File

@ -89,9 +89,6 @@ fi
unset http_proxy
unset https_proxy
unset no_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset NO_PROXY
## Clash 订阅地址检测及配置文件下载
@ -99,9 +96,16 @@ unset NO_PROXY
echo -e '\n正在检测订阅地址...'
Text1="Clash订阅地址可访问"
Text2="Clash订阅地址不可访问"
#curl -o /dev/null -s -m 10 --connect-timeout 10 -w %{http_code} $URL | grep '[23][0-9][0-9]' &>/dev/null
curl -o /dev/null -L -k -sS --retry 5 -m 10 --connect-timeout 10 -w "%{http_code}" $URL | grep -E '^[23][0-9]{2}$' &>/dev/null
for i in {1..10}
do
curl -o /dev/null -s -m 10 --connect-timeout 10 -w %{http_code} $URL | grep '[23][0-9][0-9]' &>/dev/null
ReturnStatus=$?
if [ $ReturnStatus -eq 0 ]; then
break
else
continue
fi
done
if_success $Text1 $Text2 $ReturnStatus
# 拉取更新config.yml文件
@ -131,12 +135,10 @@ if_success $Text3 $Text4 $ReturnStatus
\cp -a $Temp_Dir/clash.yaml $Temp_Dir/clash_config.yaml
## 判断订阅内容是否符合clash配置文件标准尝试转换当前不支持对 x86_64 以外的CPU架构服务器进行clash配置文件检测和转换此功能将在后续添加
if [[ $CpuArch =~ "x86_64" || $CpuArch =~ "amd64" ]]; then
## 判断订阅内容是否符合clash配置文件标准尝试转换
echo -e '\n判断订阅内容是否符合clash配置文件标准:'
bash $Server_Dir/scripts/clash_profile_conversion.sh
sleep 3
fi
## Clash 配置文件重新格式化及配置
@ -190,9 +192,6 @@ function proxy_on() {
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export no_proxy=127.0.0.1,localhost
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
export NO_PROXY=127.0.0.1,localhost
echo -e "\033[32m[√] 已开启代理\033[0m"
}
@ -201,9 +200,6 @@ function proxy_off(){
unset http_proxy
unset https_proxy
unset no_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset NO_PROXY
echo -e "\033[31m[×] 已关闭代理\033[0m"
}
EOF