From c8cfc93b60af64c8a759ce8af508d513e474ec66 Mon Sep 17 00:00:00 2001 From: juewuy Date: Thu, 23 Jul 2020 14:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eclash=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 35 ++++++--------------- clash_redir_config/clashsh | 63 ++++++++++++++++++++++++++++++++++++++ clash_tun_config/clashsh | 63 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 25 deletions(-) create mode 100644 clash_redir_config/clashsh create mode 100644 clash_tun_config/clashsh diff --git a/README.md b/README.md index 99ff5fb..559e3c0 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ===== PS: -- +•新增了管理脚本,按照完成后执行clash命令即可使用脚本!之前版本安装的用户可以将clashservice和clashsh两个文件上传到etc/clash下后重新执行安装命令即可使用
•新增了redir模式,redir模式速度更快但是不支持UDP转发;tun模式支持UDP转发,但CPU和内存占用相对更高,请根据需求选择
•支持ss,v2ray,trojan,但不支持ssr,也不支持订阅
•需要自行编辑config.yaml以配置服务器
@@ -23,34 +24,18 @@ PS: *·如有必要,也可以自行前往下载更新clash核心文件并自行改名 https://github.com/Dreamacro/clash/releases/tag/premium (小米AX3600是armv8,ax1800/ax5是armv7,其他路由器请自查)
* •将下载并修改后的4个文件通过winSCP上传到路由器/etc/clash文件夹(clash文件夹请自行创建)下(最终应该是/etc/clash/"4个文件")
•登陆SSH,并在SSH中用root用户执行下方的**对应命令**即可使用!
-**首次安装clash** +**首次安装** ```Shell -mv /etc/clash/clashservice /etc/init.d/clash #将clash服务文件移动到系统目录 -chmod 777 /etc/clash/clash #授予权限 -chmod 777 /etc/init.d/clash #授予权限 -service clash enable #启用clash开机启动 -service clash start #启动clash服务 +mv /etc/clash/clashservice /etc/init.d/clash #移动clash服务文件 +mv /etc/clash/clashsh /bin/clash #移动clash管理脚本 +chmod 777 /etc/clash/clash #授予权限 +chmod 777 /etc/init.d/clash #授予权限 +chmod 777 /bin/clash #授予权限 +clash #使用管理脚本 ``` -**停止clash** +**管理脚本** ```Shell -service clash stop #停止clash服务 -``` -**启用clash** -```Shell -service clash start #启动clash服务 -``` -**设置clash开机启动** -```Shell -service clash enable #启用clash开机启动 -``` -**禁止clash开机启动** -```Shell -service clash disable #禁止clash开机启动 -``` -**卸载clash相关文件** -```Shell -rm -rf /etc/clash #删除clash文件夹及文件 -rm /etc/init.d/clash #删除clash开机启动文件 +clash #使用管理脚本 ``` •启用后可以通过 http://clash.razord.top (IP为网关IP,端口为9999)管理clash内置规则
diff --git a/clash_redir_config/clashsh b/clash_redir_config/clashsh new file mode 100644 index 0000000..f4cc441 --- /dev/null +++ b/clash_redir_config/clashsh @@ -0,0 +1,63 @@ +#!/bin/sh +# Copyright (C) 2006-2011 OpenWrt.org + +echo "***********************************************" +echo "** 欢迎使用 **" +echo "** Clash for Miwifi **" +echo "** by Juewuy **" +echo "***********************************************" +echo 1 启动clash服务 +echo 2 重启clash服务 +echo 3 停止clash服务 +echo 4 设置clash开机启动 +echo 5 禁止clash开机启动 +echo 6 卸载clash相关文件(慎用!) +echo 0 退出脚本 +read -p "请输入对应数字>" num + if [[ $num == 0 ]]; then + exit; + + elif [[ $num == 1 ]]; then + /etc/init.d/clash start + echo clash服务已启动! + echo 可以使用 http://clash.razord.top (IP为网关IP,端口为9999)管理clash内置规则 + exit; + + elif [[ $num == 2 ]]; then + /etc/init.d/clash stop + /etc/init.d/clash start + echo clash服务已启动! + echo 可以使用 http://clash.razord.top (IP为网关IP,端口为9999)管理clash内置规则 + exit; + + elif [[ $num == 3 ]]; then + /etc/init.d/clash stop + echo clash服务已停止! + exit; + + elif [[ $num == 4 ]]; then + /etc/init.d/clash enable + echo 已设置clash开机启动! + exit; + + elif [[ $num == 5 ]]; then + /etc/init.d/clash disable + echo 已禁止clash开机启动! + exit; + + elif [[ $num == 6 ]]; then + read -p "确认卸载clash?[1/0] " res + if [ "$res" = '1' ]; then + /etc/init.d/clash disable + /etc/init.d/clash stop + rm -rf /etc/clash + rm /etc/init.d/clash + rm /bin/clash + echo 已卸载clash相关文件! + fi + exit; + + else + echo 请输入正确的数字! + fi + exit 1 diff --git a/clash_tun_config/clashsh b/clash_tun_config/clashsh new file mode 100644 index 0000000..f4cc441 --- /dev/null +++ b/clash_tun_config/clashsh @@ -0,0 +1,63 @@ +#!/bin/sh +# Copyright (C) 2006-2011 OpenWrt.org + +echo "***********************************************" +echo "** 欢迎使用 **" +echo "** Clash for Miwifi **" +echo "** by Juewuy **" +echo "***********************************************" +echo 1 启动clash服务 +echo 2 重启clash服务 +echo 3 停止clash服务 +echo 4 设置clash开机启动 +echo 5 禁止clash开机启动 +echo 6 卸载clash相关文件(慎用!) +echo 0 退出脚本 +read -p "请输入对应数字>" num + if [[ $num == 0 ]]; then + exit; + + elif [[ $num == 1 ]]; then + /etc/init.d/clash start + echo clash服务已启动! + echo 可以使用 http://clash.razord.top (IP为网关IP,端口为9999)管理clash内置规则 + exit; + + elif [[ $num == 2 ]]; then + /etc/init.d/clash stop + /etc/init.d/clash start + echo clash服务已启动! + echo 可以使用 http://clash.razord.top (IP为网关IP,端口为9999)管理clash内置规则 + exit; + + elif [[ $num == 3 ]]; then + /etc/init.d/clash stop + echo clash服务已停止! + exit; + + elif [[ $num == 4 ]]; then + /etc/init.d/clash enable + echo 已设置clash开机启动! + exit; + + elif [[ $num == 5 ]]; then + /etc/init.d/clash disable + echo 已禁止clash开机启动! + exit; + + elif [[ $num == 6 ]]; then + read -p "确认卸载clash?[1/0] " res + if [ "$res" = '1' ]; then + /etc/init.d/clash disable + /etc/init.d/clash stop + rm -rf /etc/clash + rm /etc/init.d/clash + rm /bin/clash + echo 已卸载clash相关文件! + fi + exit; + + else + echo 请输入正确的数字! + fi + exit 1