- 克隆 clash for linux 项目
 
1
   | git clone https://github.com/wanhebin/clash-for-linux.git
   | 
 
- 进入目录,修改 .env 文件中的订阅地址
 
1 2
   | cd clash-for-linux vim .env
   | 
 
CLASH_URL 是订阅地址 ,CLASH_SECRET 是 web 界面的密码

- 执行启动脚本
 
- 加载环境变量
 
1
   | source /etc/profile.d/clash.sh
   | 
 
- 启动或关闭代理
 
1 2 3 4
   | # 开启 proxy_on # 关闭 proxy_off
   | 
 
检测服务端口
1 2 3 4 5
   | $ netstat -tln | grep -E '9090|789.' tcp        0      0 127.0.0.1:9090          0.0.0.0:*               LISTEN      tcp6       0      0 :::7890                 :::*                    LISTEN      tcp6       0      0 :::7891                 :::*                    LISTEN      tcp6       0      0 :::7892                 :::*                    LISTEN
   | 
 
检测环境变量
1 2 3
   | $ env | grep -E 'http_proxy|https_proxy' http_proxy=http://127.0.0.1:7890 https_proxy=http://127.0.0.1:7890
   |