Compare commits

...

12 Commits

Author SHA1 Message Date
wanhebin
0c119aaba5
Merge pull request #145 from wanhebin/dev
修复Broken pipe问题 #144
2023-08-28 18:55:34 +08:00
wanhebin
f3c0c0946a 修复Broken pipe问题 #144 2023-08-28 18:47:13 +08:00
wanhebin
ceb967a18d
Merge pull request #107 from wanhebin/dev
删除bin目录下clash启动程序的软连接。修复问题 #104
2023-07-04 13:50:25 +08:00
wanhebin
d36ed1ab58 删除bin目录下clash启动程序的软连接。修复问题 #104 2023-07-04 13:44:06 +08:00
wanhebin
f0cfb38759
Merge pull request #99 from wanhebin/dev
增强代理相关变量的适配性。部分Linux发行版会使用大写的变量  #95
2023-06-28 17:47:30 +08:00
wanhebin
fb45e96a9e
Update README.md 2023-06-28 14:38:07 +08:00
wanhebin
fa6e99cbd8
Update start.sh
增强代理相关变量的适配性。部分Linux发行版会使用大写的变量  #95
2023-06-26 23:32:24 +08:00
wanhebin
c0505cb1b8
Merge pull request #90 from wanhebin/dev
Update start.sh
2023-06-17 15:07:55 +08:00
wanhebin
fc11d95eef
Update start.sh
对curl命令检测订阅地址可用性进行优化。
2023-06-17 04:17:12 +08:00
wanhebin
80716750b1
Merge pull request #88 from wanhebin/dev
对配置文件转换添加限制,只对x86_64 架构的服务器进行转换。
2023-06-16 00:27:00 +08:00
wanhebin
fc8e8817f7
Update start.sh
对配置文件转换添加限制,只对x86_64 架构的服务器进行转换。
2023-06-16 00:24:22 +08:00
wanhebin
71e8d7b502
Update start.sh
对配置文件转换添加限制,只对x86_64 架构的服务器进行转换。
2023-06-16 00:13:58 +08:00
9 changed files with 22 additions and 17 deletions

View File

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

View File

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

BIN
bin/clash-linux-amd64 Executable file

Binary file not shown.

Binary file not shown.

View File

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

BIN
bin/clash-linux-arm64 Executable file

Binary file not shown.

Binary file not shown.

View File

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

BIN
bin/clash-linux-armv7 Executable file

Binary file not shown.

Binary file not shown.

View File

@ -22,10 +22,9 @@ else
else
echo "解码后的内容不符合clash标准尝试将其转换为标准格式"
${Server_Dir}/tools/subconverter/subconverter -g &>> ${Server_Dir}/logs/subconverter.log
converted_content=$(cat ${Server_Dir}/temp/clash_config.yaml)
converted_file=${Server_Dir}/temp/clash_config.yaml
# 判断转换后的内容是否符合clash配置文件标准
#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
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
echo "配置文件已成功转换成clash标准格式"
else
echo "配置文件转换标准格式失败"

View File

@ -89,6 +89,9 @@ fi
unset http_proxy
unset https_proxy
unset no_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset NO_PROXY
## Clash 订阅地址检测及配置文件下载
@ -96,16 +99,9 @@ unset no_proxy
echo -e '\n正在检测订阅地址...'
Text1="Clash订阅地址可访问"
Text2="Clash订阅地址不可访问"
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
#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
ReturnStatus=$?
if_success $Text1 $Text2 $ReturnStatus
# 拉取更新config.yml文件
@ -135,10 +131,12 @@ if_success $Text3 $Text4 $ReturnStatus
\cp -a $Temp_Dir/clash.yaml $Temp_Dir/clash_config.yaml
## 判断订阅内容是否符合clash配置文件标准尝试转换
echo -e '\n判断订阅内容是否符合clash配置文件标准:'
bash $Server_Dir/scripts/clash_profile_conversion.sh
sleep 3
## 判断订阅内容是否符合clash配置文件标准尝试转换当前不支持对 x86_64 以外的CPU架构服务器进行clash配置文件检测和转换此功能将在后续添加
if [[ $CpuArch =~ "x86_64" || $CpuArch =~ "amd64" ]]; then
echo -e '\n判断订阅内容是否符合clash配置文件标准:'
bash $Server_Dir/scripts/clash_profile_conversion.sh
sleep 3
fi
## Clash 配置文件重新格式化及配置
@ -192,6 +190,9 @@ 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"
}
@ -200,6 +201,9 @@ 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