Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@

# 使用须知

- 运行本项目建议使用root用户,或者使用 sudo 提权。
- 使用过程中如遇到问题,请优先查已有的 [issues](https://github.com/wanhebin/clash-for-linux/issues)。
- 在进行issues提交前,请替换提交内容中是敏感信息(例如:订阅地址)。
- 本项目是基于 [clash](https://github.com/Dreamacro/clash) 、[yacd](https://github.com/haishanh/yacd) 进行的配置整合,关于clash、yacd的详细配置请去原项目查看。
- 此项目不提供任何订阅信息,请自行准备Clash订阅地址。
- 运行前请手动更改`.env`文件中的`CLASH_URL`变量值,否则无法正常运行。
- 当前在RHEL系列和Debian系列Linux系统中测试过,其他系列可能需要适当修改脚本。
- 支持 x86_64/aarch64 平台
- 如果配置已经下载过,用户可以通过 `--skip-download-config` 参数跳过下载配置文件的步骤。
- 如果用户不希望写入 /etc/profile.d/clash.sh,可以使用 `--skip-edit-profile` 参数跳过写入操作。

> **注意**:当你在使用此项目时,遇到任何无法独自解决的问题请优先前往 [Issues](https://github.com/wanhebin/clash-for-linux/issues) 寻找解决方法。由于空闲时间有限,后续将不再对Issues中 “已经解答”、“已有解决方案” 的问题进行重复性的回答。

Expand Down
Binary file added icon/Clash_Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions icon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Clash Logo 图标

请将 Clash Logo 图标文件 `Clash_Logo.png` 放置在此目录下。

你可以从以下位置获取 Clash Logo:
1. 从官方仓库下载
2. 从其他 Clash 客户端提取
3. 使用任何 Clash 相关的 Logo 图片,并重命名为 `Clash_Logo.png`

图标要求:
- 文件名必须是:`Clash_Logo.png`
- 建议尺寸:128x128 像素或更大
- 格式:PNG(透明背景)
33 changes: 32 additions & 1 deletion shutdown.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#!/bin/bash

# 初始化跳过编辑profile标志
SKIP_EDIT_PROFILE=false

# 处理命令行参数
while [[ $# -gt 0 ]]; do
case $1 in
--skip-edit-profile)
SKIP_EDIT_PROFILE=true
shift
;;
*)
echo "未知参数: $1"
exit 1
;;
esac
done

# 关闭clash服务
PID_NUM=`ps -ef | grep [c]lash-linux-a | wc -l`
PID=`ps -ef | grep [c]lash-linux-a | awk '{print $2}'`
Expand All @@ -9,6 +26,20 @@ if [ $PID_NUM -ne 0 ]; then
fi

# 清除环境变量
> /etc/profile.d/clash.sh
if [ "$SKIP_EDIT_PROFILE" = false ]; then
if [ "$(id -u)" -eq 0 ]; then
> /etc/profile.d/clash.sh
else
echo "错误:需要 root 权限才能修改 /etc/profile.d/clash.sh" >&2
fi
fi

# 检查并关闭系统托盘图标
PID_NUM=`ps -ef | grep [y]ad | grep -i clash | wc -l`
PID=`ps -ef | grep [y]ad | grep -i clash | awk '{print $2}'`
if [ $PID_NUM -ne 0 ]; then
kill -9 $PID
echo -e "\n[INFO] 已移除系统托盘图标"
fi

echo -e "\n服务关闭成功,请执行以下命令关闭系统代理:proxy_off\n"
Loading