centos命令行安装clash,设置快捷启动和开机自启动 | 您所在的位置:网站首页 › 关闭代理后使用app › centos命令行安装clash,设置快捷启动和开机自启动 |
下载客户端
1.创建一个clash文件夹,我放到opt目录,根据自己修改
mkdir /opt/clash && cd /opt/clash
复制代码
wget http://gh.301.ee/https://github.com/Dreamacro/clash/releases/download/v1.10.6/clash-linux-amd64-v1.10.6.gz
复制代码
上面是句废话,因为这个时候还没有翻墙,能翻墙就不需要Clash了 从另一台可访问Github的电脑去下载github.com/Dreamacro/c… 最新的版本并拷贝到/opt/clash 位置
[root@xxx clash]# wget -O /opt/clash/config.yaml "clash的订阅链接" --no-check-certificate [root@xxx clash]# wget dl.ssrss.club/Country.mmd… --no-check-certificate 运行程序 ./clash -d /opt/clash/ 复制代码 启动程序 回到/opt/clash目录, 带上-d指定配置文件目录 ./clash -d /opt/clash/ 复制代码 如下图就是clash启动成功了curl www.google.com 看到句尾是DIRECT是直连,其他的使用配置的信息则代理成功 添加服务 vim /usr/lib/systemd/system/clash.service 粘贴如下内容 [Unit] Description=clash [Service] TimeoutStartSec=0 ExecStart=/opt/clash/clash -d /opt/clash [Install] WantedBy=multi-user.target 复制代码ExecStart代表启动命令 启动或者重启重新加载systemctl配置: systemctl daemon-reload 启动Clash: systemctl start clash 关闭Clash: systemctl stop clash 查看状态(可以用来检测是否成功启动): systemctl status clash 设置开机自启: systemctl enable clash 取消开机自启: systemctl disable clash 关闭clash后关闭本地代理 [root@xxx clash]# unset http_proxy [root@xxx clash]# unset https_proxy 复制代码 可能会遇到的问题 配置端点不可用,需要切换端点。 在可以用的电脑上重新拷贝一份可用的config.yaml,重启clash |
CopyRight 2018-2019 实验室设备网 版权所有 |