diff --git a/README.md b/README.md index 4a34772..abb7640 100644 --- a/README.md +++ b/README.md @@ -104,3 +104,4 @@ $ unset https_proxy - 此项目不提供任何订阅信息,请自行准备Clash订阅地址。 - 运行前请手动更改`start.sh`脚本中的URL变量值,否则无法正常运行。 - 当前在RHEL系列和Debian系列Linux系统中测试过,其他系列可能需要适当修改脚本。 +- 支持 x86_64/aarch64 平台 diff --git a/bin/clash-linux-armv7 b/bin/clash-linux-armv7 new file mode 120000 index 0000000..4938b99 --- /dev/null +++ b/bin/clash-linux-armv7 @@ -0,0 +1 @@ +clash-linux-armv7-v.1.3.5 \ No newline at end of file diff --git a/bin/clash-linux-armv7-v.1.3.5 b/bin/clash-linux-armv7-v.1.3.5 new file mode 100755 index 0000000..497f663 Binary files /dev/null and b/bin/clash-linux-armv7-v.1.3.5 differ diff --git a/shutdown.sh b/shutdown.sh index dc1a8db..cad4e06 100755 --- a/shutdown.sh +++ b/shutdown.sh @@ -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 # 清除环境变量 diff --git a/start.sh b/start.sh index 64a67d7..bdafd9b 100755 --- a/start.sh +++ b/start.sh @@ -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