Add ARM architecture support

This commit is contained in:
wanhebin 2022-01-14 23:14:50 +08:00
parent 06205ba612
commit 5702267e22
5 changed files with 17 additions and 5 deletions

View File

@ -104,3 +104,4 @@ $ unset https_proxy
- 此项目不提供任何订阅信息请自行准备Clash订阅地址。
- 运行前请手动更改`start.sh`脚本中的URL变量值否则无法正常运行。
- 当前在RHEL系列和Debian系列Linux系统中测试过其他系列可能需要适当修改脚本。
- 支持 x86_64/aarch64 平台

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

@ -0,0 +1 @@
clash-linux-armv7-v.1.3.5

BIN
bin/clash-linux-armv7-v.1.3.5 Executable file

Binary file not shown.

View File

@ -1,11 +1,11 @@
#!/bin/bash
# 关闭clash服务
PID_NUM=`ps -ef | grep [c]lash-linux-amd64 | wc -l`
PID=`ps -ef | grep [c]lash-linux-amd64 | awk '{print $2}'`
PID_NUM=`ps -ef | grep [c]lash-linux-a | wc -l`
PID=`ps -ef | grep [c]lash-linux-a | awk '{print $2}'`
if [ $PID_NUM -ne 0 ]; then
kill -9 $PID
# ps -ef | grep [c]lash-linux-amd64 | awk '{print $2}' | xargs kill -9
# ps -ef | grep [c]lash-linux-a | awk '{print $2}' | xargs kill -9
fi
# 清除环境变量

View File

@ -73,8 +73,18 @@ cat $Temp_Dir/proxy.txt >> $Temp_Dir/config.yaml
# 启动Clash服务
Text5="服务启动成功!"
Text6="服务启动失败!"
nohup $Server_Dir/bin/clash-linux-amd64 -d $Conf_Dir &> $Log_Dir/clash.log &
if_success $Text5 $Text6
# 获取CPU架构 x86_64/aarch64
get_arch=`/bin/arch`
if [[ $get_arch =~ "x86_64" ]]; then
nohup $Server_Dir/bin/clash-linux-amd64 -d $Conf_Dir &> $Log_Dir/clash.log &
if_success $Text5 $Text6
elif [[ $get_arch =~ "aarch64" ]]; then
nohup $Server_Dir/bin/clash-linux-armv7 -d $Conf_Dir &> $Log_Dir/clash.log &
if_success $Text5 $Text6
else
echo -e "\033[31m[ERROR] Unsupported CPU Architecture\033[0m"
exit 1
fi
# 添加环境变量(root权限)
echo -e "export http_proxy=http://127.0.0.1:7890\nexport https_proxy=http://127.0.0.1:7890\nexport no_proxy=127.0.0.1,localhost" > /etc/profile.d/clash.sh