151 Commits

Author SHA1 Message Date
juewuy
7b3e38e4c6 v1.0.0beta18fix
~回退armv5核心为未压缩状态
~修复定时任务界面层级错乱的bug
~修复过滤局域网设备无法正确读取dhcp列表的bug
2020-12-17 09:59:18 +08:00
juewuy
cee0a10548 v1.0.0beta18
~回退armv5核心为未压缩状态
~修复定时任务界面层级错乱的bug
~修复过滤局域网设备无法正确读取dhcp列表的bug
2020-12-17 09:58:01 +08:00
juewuy
cf7ff363e0 v1.0.0beta18
~回退armv5核心为未压缩状态
~修复定时任务界面层级错乱的bug
~修复过滤局域网设备无法正确读取dhcp列表的bug
2020-12-17 09:57:33 +08:00
juewuy
eebffa662f v1.0.0beta18
~回退armv5核心为未压缩状态
~修复定时任务界面层级错乱的bug
2020-12-15 10:36:21 +08:00
juewuy
41080fb146 v1.0.0beta18
~回退armv5核心为未压缩状态
~修复定时任务界面层级错乱的bug
2020-12-15 10:35:39 +08:00
juewuy
c1379cde16 v1.0.0beta17.9
~增加了一键切换加密dns的功能
~修复了切换安装源时会偶尔清空配置文件的bug
~修复了下载失败并提示127.0.0.1无法连接的bug
2020-12-14 16:38:48 +08:00
juewuy
2ec1fd6e74 v1.0.0beta17.9
~增加了一键切换加密dns的功能
~修复了切换安装源时会偶尔清空配置文件的bug
~修复了下载失败并提示127.0.0.1无法连接的bug
2020-12-14 16:38:14 +08:00
juewuy
c5089f0277 v1.0.0beta17.8
~增加了对padavan系统读取局域网设备过滤列表的支持
~优化了配置文件保存方式,减少闪存消耗
~修复了部分mipsle设备无法正确识别核心的bug
~修复了部分情况下订阅链接/配置链接丢失的bug
~修复了部分情况下会连续下载两次核心的bug
2020-12-13 22:13:27 +08:00
juewuy
872a84abc1 v1.0.0beta17.8
~增加了对padavan系统读取局域网设备过滤列表的支持
~优化了配置文件保存方式,减少闪存消耗
~修复了部分mipsle设备无法正确识别核心的bug
~修复了部分情况下订阅链接/配置链接丢失的bug
~修复了部分情况下会连续下载两次核心的bug
2020-12-13 22:12:52 +08:00
juewuy
66cc65f239 v1.0.0beta17.8
~增加了对padavan系统读取局域网设备过滤列表的支持
~优化了配置文件保存方式,减少闪存消耗
~修复了部分mipsle设备无法正确识别核心的bug
~修复了部分情况下订阅链接/配置链接丢失的bug
~修复了部分情况下会连续下载两次核心的bug
2020-12-13 21:22:41 +08:00
juewuy
2fa0840c6e v1.0.0beta17.8
~优化了保存节点信息的方式,节省存储消耗
~修复了部分情况下订阅链接/配置链接丢失的bug
~修复了部分情况下会连续下载两次核心的bug
2020-12-13 16:40:19 +08:00
juewuy
5924a3ecf7 v1.0.0beta17.8
~优化了保存节点信息的方式,节省存储消耗
~修复了部分情况下订阅链接/配置链接丢失的bug
2020-12-13 13:57:37 +08:00
juewuy
91ada9f49f v1.0.0beta17.8
~修复了部分情况下订阅链接/配置链接丢失的bug
2020-12-13 12:39:25 +08:00
juewuy
67e8626e8a v1.0.0beta17.7
~增加了在使用功能设置变更配置后告知用户重启的提示
~修复定时更新订阅时不会重启clash服务的bug
~优化语句结构,修复部分情况下菜单层级错乱的bug
~修复卸载时不会清除部分定时任务的bug
~修复pac在部分设备上不可用的bug(待测试)
2020-12-12 18:30:18 +08:00
juewuy
9f9d3c3dcb v1.0.0beta17.7
~增加了在使用功能设置变更配置后告知用户重启的提示
~修复定时更新订阅时不会重启clash服务的bug
~优化语句结构,修复部分情况下菜单层级错乱的bug
~修复卸载时不会清除部分定时任务的bug
~修复pac在部分设备上不可用的bug(待测试)
2020-12-12 18:29:59 +08:00
juewuy
82cadd1aaf v1.0.0beta17.7
~修复定时更新订阅时不会重启clash服务的bug
~优化语句结构,修复部分情况下菜单层级错乱的bug
2020-12-12 13:30:19 +08:00
juewuy
c12d59231d v1.0.0beta17.7
~修复定时更新订阅时不会重启clash服务的bug
~优化语句结构,修复部分情况下菜单层级错乱的bug
2020-12-12 13:30:00 +08:00
juewuy
3ef6effe78 v1.0.0beta17.7
~修复定时更新订阅时不会重启clash服务的bug
2020-12-12 12:20:22 +08:00
juewuy
f72df657db v1.0.0beta17.6
~大幅度调整和优化导入配置文件功能
~大幅度调整和优化新手引导逻辑和步骤
~新增Hackl0us提供的精简版GeoIP数据库下载
~修复部分情况下提示本地代理连接失败的bug
~修复导入配置文件功能部分bug
2020-12-12 10:27:20 +08:00
juewuy
89bca53889 v1.0.0beta17.6
~大幅度调整和优化导入配置文件功能
~大幅度调整和优化新手引导逻辑和步骤
~新增Hackl0us提供的精简版GeoIP数据库下载
~修复部分情况下提示本地代理连接失败的bug
~修复导入配置文件功能部分bug
2020-12-12 10:27:03 +08:00
juewuy
656682be14 v1.0.0beta17.5
~大幅度调整和优化导入配置文件功能
~大幅度调整和优化新手引导逻辑和步骤
~新增Hackl0us提供的精简版GeoIP数据库下载
~修复部分情况下提示本地代理连接失败的bug
2020-12-11 22:26:07 +08:00
juewuy
bdc84608d2 v1.0.0beta17.5
~大幅度调整和优化导入配置文件功能
~大幅度调整和优化新手引导逻辑和步骤
~新增Hackl0us提供的精简版GeoIP数据库下载
~修复部分情况下提示本地代理连接失败的bug
2020-12-11 22:17:29 +08:00
juewuy
533f856b0b v1.0.0beta17.4
~新增安装本地根证书文件功能,用于解决各种证书验证问题及x509报错问题
2020-12-09 13:03:42 +08:00
juewuy
c87208983b v1.0.0beta17.3
~新增自定义默认过滤端口功能
~屏蔽已被封禁的gitee下载源
~修复新用户无法正常启动新手引导的bug
~修复部分设备重启后代理失效的bug
~修复偶尔检测更新出错的bug
2020-12-08 23:25:57 +08:00
juewuy
5adb662ece v1.0.0beta17.3
~新增自定义默认过滤端口功能
~屏蔽已被封禁的gitee下载源
~修复新用户无法正常启动新手引导的bug
~修复部分设备重启后代理失效的bug
~修复偶尔检测更新出错的bug
2020-12-08 23:21:50 +08:00
juewuy
0f4fbd8d68 v1.0.0beta17.3
~新增自定义默认过滤端口功能
~屏蔽已被封禁的gitee下载源
~修复部分设备重启后代理失效的bug
~修复偶尔检测更新出错的bug
2020-12-08 20:47:33 +08:00
juewuy
15deb9a608 v1.0.0beta17.3
~新增自定义默认过滤端口功能
~屏蔽已被封禁的gitee下载源
~修复部分设备重启后代理失效的bug
~修复偶尔检测更新出错的bug
2020-12-08 20:42:03 +08:00
juewuy
62c3566ac9 v1.0.0beta17.3
~新增自定义默认过滤端口功能
~屏蔽已被封禁的gitee下载源
~修复部分设备重启后代理失效的bug
~修复偶尔检测更新出错的bug
2020-12-08 20:37:49 +08:00
juewuy
09432eee01 v1.0.0beta17.3
~修复偶尔检测更新出错的bug
2020-12-03 13:06:40 +08:00
juewuy
bb28742b86 v1.0.0beta17.2
~同步官方最新1.3.0版本clash核心及premium核心
~同步最新GeoIP数据库文件
~同步最新dashboard面板文件
~修复使用在线节点时获取配置文件报错的bug
~修复手动更新订阅界面不显示已保存链接的bug
~下载dashboard面板时,自动检测目录是否可写
~修复下载配置文件失败后依然显示clash启动的bug
2020-11-22 15:40:31 +08:00
juewuy
f316957a64 v1.0.0beta17.2
~同步官方最新1.3.0版本clash核心及premium核心
~同步最新GeoIP数据库文件
~同步最新dashboard面板文件
~修复使用在线节点时获取配置文件报错的bug
~修复手动更新订阅界面不显示已保存链接的bug
~下载dashboard面板时,自动检测目录是否可写
~修复下载配置文件失败后依然显示clash启动的bug
2020-11-22 15:21:24 +08:00
juewuy
2a2ee0b90d v1.0.0beta17.2
~修复使用在线节点时获取配置文件报错的bug
~修复手动更新订阅界面不显示已保存链接的bug
~下载dashboard面板时,自动检测目录是否可写
~修复下载配置文件失败后依然显示clash启动的bug
2020-11-22 15:11:39 +08:00
juewuy
a5cbde33e1 Merge branch 'master' of https://github.com/juewuy/clash-for-Miwifi into master 2020-11-22 15:11:00 +08:00
juewuy
893b6f1dae Update README.md 2020-11-22 10:57:50 +08:00
juewuy
de571b58e3 v1.0.0beta17.2
~修复使用在线节点时获取配置文件报错的bug
~修复手动更新订阅界面不显示已保存链接的bug
~下载dashboard面板时,自动检测目录是否可写
2020-11-15 13:01:29 +08:00
juewuy
7e528f5b2b v1.0.0beta17.1
~修复部分设备无法使用mac过滤的bug
~更新菜单增加PAC配置地址及说明
2020-11-12 15:29:06 +08:00
juewuy
c28eb1cbbc v1.0.0beta17.1
~修复部分设备无法使用mac过滤的bug
~更新菜单增加PAC配置地址及说明
2020-11-12 14:30:17 +08:00
juewuy
3a85ac1499 v1.0.0beta17.1
~修复部分设备无法使用mac过滤的bug
~更新菜单增加PAC配置地址及说明
2020-11-12 14:20:01 +08:00
juewuy
558a2ee6d8 v1.0.0beta17fix
~修复下载yacd面板后无法自动配置访问IP的bug
2020-11-09 16:16:14 +08:00
juewuy
aaa1228319 v1.0.0beta17
~同步最新版本Geoip数据库
~新增更新切换版本到其他release版本的功能
~调整release版本更新检测机制
~修复部分设备提示缺少cmb的问题
~修复使用自定义规则时,每次启动clash规则都会被重复导入的问题
~进一步优化面板保存机制
2020-11-08 15:06:30 +08:00
juewuy
5cdf5a520e v1.0.0beta17
~同步最新版本Geoip数据库
~新增更新切换版本到其他release版本的功能
~调整release版本更新检测机制
~修复部分设备提示缺少cmb的问题
~修复使用自定义规则时,每次启动clash规则都会被重复导入的问题
~进一步优化面板保存机制
2020-11-08 15:02:24 +08:00
juewuy
ff7f6e7dc0 v1.0.0beta16.9
~新增更新切换版本到其他release版本的功能
~调整release版本更新检测机制
~修复部分设备提示缺少cmb的问题
~修复使用自定义规则时,每次启动clash规则都会被重复导入的问题
~进一步优化面板保存机制
2020-11-07 12:08:49 +08:00
juewuy
ed30acdd7a v1.0.0beta16.9
~新增更新切换版本到其他release版本的功能
~调整release版本更新检测机制
~修复部分设备提示缺少cmb的问题
~修复使用自定义规则时,每次启动clash规则都会被重复导入的问题
~进一步优化面板保存机制
2020-11-07 12:08:31 +08:00
juewuy
1d38865e03 v1.0.0beta16.9
~调整release版本更新检测机制
2020-11-07 11:49:36 +08:00
juewuy
5cb5bfe5e0 v1.0.0beta16.9
~调整release版本更新检测机制
2020-11-07 11:45:34 +08:00
juewuy
286f043849 v1.0.0beta16.8
~优化了mac地址导入和删除,现在不完全依赖dhcp服务
~优化了合并配置文件的方式,修复部分设备报错的bug
~修复保守模式守护进程未能正确添加的bug
~修复某些情况下提示iptables链已创建的bug
~修复了某些情况下重启导致保持节点被重置的bug
2020-11-06 16:59:49 +08:00
juewuy
44940d3496 v1.0.0beta16.8
~优化了mac地址导入和删除,现在不完全依赖dhcp服务
~优化了合并配置文件的方式,修复部分设备报错的bug
2020-11-05 22:14:14 +08:00
juewuy
4bceb9af59 v1.0.0beta16.8
~优化了mac地址导入和删除,现在不完全依赖dhcp服务
2020-11-05 21:54:38 +08:00
juewuy
9c0440caaf v1.0.0beta16.7
~增加tproxy——udp模式对黑白名单mac过滤的适配
~优化导入自定义配置文件功能
~修复ip6tables在不可用时仍旧强行使用导致报错的bug
~修复ipv6dns导致污染的bug
2020-11-05 20:58:17 +08:00
juewuy
8fbb88b707 v1.0.0beta16.7
~增加tproxy——udp模式对黑白名单mac过滤的适配
~优化导入自定义配置文件功能
~修复ip6tables在不可用时仍旧强行使用导致报错的bug
~修复ipv6dns导致污染的bug
2020-11-05 20:53:27 +08:00
juewuy
6957d57f1f v1.0.0beta16.7
~增加tproxy——udp模式对黑白名单mac过滤的适配
~优化导入自定义配置文件功能
~修复ip6tables在不可用时仍旧强行使用导致报错的bug
~修复ipv6dns导致污染的bug
2020-11-05 20:53:05 +08:00
juewuy
d0ecb222ab v1.0.0beta16.6
~优化自定义规则及配置的导入方式,增加示例文件
~优化mac白名单导致部分设备ip6tables报错的问题,待测试
2020-11-05 15:03:53 +08:00
juewuy
771082da78 v1.0.0beta16.6
~优化自定义规则及配置的导入方式,增加示例文件
~优化mac白名单导致部分设备ip6tables报错的问题,待测试
2020-11-05 15:03:31 +08:00
juewuy
4a371398cf v1.0.0beta16.6
~优化自定义规则及配置的导入方式,增加示例文件
~优化mac白名单导致部分设备ip6tables报错的问题,待测试
2020-11-05 14:59:37 +08:00
juewuy
b63a6c52a4 v1.0.0beta16.6
~优化自定义规则及配置的导入方式,增加示例文件
~优化mac白名单导致部分设备ip6tables报错的问题,待测试
2020-11-05 14:55:23 +08:00
juewuy
2fcbeb7655 v1.0.0beta16.6
~优化自定义规则及配置的导入方式,增加示例文件
~优化mac白名单导致部分设备ip6tables报错的问题,待测试
2020-11-05 14:54:52 +08:00
juewuy
7bb60f7aab v1.0.0beta16.5
~修复白名单模式部分情况下不可用的bug
~屏蔽不使用本地dns功能,如有需求可在dns配置中自行编辑
~屏蔽使用自定义配置功能,现在可以手动将自定义设置写入user.yaml、自定义规则写入rules.yaml,运行时会自动合并配置文件
~修复设置http代理加密后导致更新检测失败的bug
~修复添加3个以上dns时添加失败的bug
2020-11-03 23:11:16 +08:00
juewuy
9624b5456c v1.0.0beta16.5
~修复白名单模式部分情况下不可用的bug
~屏蔽不使用本地dns功能,如有需求可在dns配置中自行编辑
~屏蔽使用自定义配置功能,现在可以手动将自定义设置写入user.yaml、自定义规则写入rules.yaml,运行时会自动合并配置文件
~修复设置http代理加密后导致更新检测失败的bug
~修复添加3个以上dns时添加失败的bug
2020-11-03 23:10:57 +08:00
juewuy
fcc211a6a7 v1.0.0beta16.4
~增加mac过滤白名单功能
~屏蔽不使用本地dns功能,如有需求可在dns配置中自行编辑
~屏蔽使用自定义配置功能,现在可以手动将自定义设置写入user.yaml、自定义规则写入rules.yaml,运行时会自动合并配置文件
~修复设置http代理加密后导致更新检测失败的bug
~修复添加3个以上dns时添加失败的bug
2020-11-03 16:50:32 +08:00
juewuy
9687748b85 v1.0.0beta16.4
~增加mac过滤白名单功能
~屏蔽不使用本地dns功能,如有需求可在dns配置中自行编辑
~屏蔽使用自定义配置功能,现在可以手动将自定义设置写入user.yaml、自定义规则写入rules.yaml,运行时会自动合并配置文件
~修复设置http代理加密后导致更新检测失败的bug
~修复添加3个以上dns时添加失败的bug
2020-11-03 16:50:10 +08:00
juewuy
6949df4e3d v1.0.0beta16.4
~增加mac过滤白名单功能
~屏蔽不使用本地dns功能,如有需求可在dns配置中自行编辑
~屏蔽使用自定义配置功能,现在可以手动将配置文件写入user.yaml,运行时会自动合并配置文件
~修复设置http代理加密后导致更新检测失败的bug
2020-11-03 16:41:41 +08:00
juewuy
7ee2085ce4 v1.0.0beta16.3
~修复部分设备启动时报错的bug
~大幅度优化新手引导
~新增小闪存模式,适合ROM大小较低的设备使用
~全新的下载机制,现在会在运行时自动下载核心文件
~修复部分设备tun模式不可启用的bug
2020-11-01 20:15:11 +08:00
juewuy
e62797205c v1.0.0beta16.2
~大幅度优化新手引导
~新增小闪存模式,适合ROM大小较低的设备使用
~全新的下载机制,现在会在运行时自动下载核心文件
~修复部分设备tun模式不可启用的bug
2020-11-01 12:13:14 +08:00
juewuy
5b7a31f044 v1.0.0beta16.2
~大幅度优化新手引导
~新增小闪存模式,适合ROM大小较低的设备使用
~全新的下载机制,现在会在运行时自动下载核心文件
~修复部分设备tun模式不可启用的bug
2020-11-01 12:12:50 +08:00
juewuy
33ca5f3969 v1.0.0beta16.1
~回退最新premium核心,修复bug
2020-11-01 11:41:55 +08:00
juewuy
56f588be92 v1.0.0beta16.1
~适配支持wget
~增加脚本日志以及查看日志功能
~新增自定义http/sock5代理认证功能
~新增支持安装内置yacd面板
~增加自定义DNS配置功能
~Redir模式增加基于tproxy的udp代理
~增加Gnome以及KDE桌面的自动设置本机代理功能

~同步GeoIP数据库及Dashboard面板文件
~回退premium测试版核心,修复bug

~优化了本机代理实现方式,增加了选项菜单
~优化了定时任务实现方式,适配更多设备
~优化了配置文件修饰方式
~优化安装脚本

~修复部分情况下开机自启显示错误的bug
~修复部分设备无法正常显示局域网连接ip/mac的bug
~修复iptables报错的bug
~修复各种更新检测失败的bug
~修复关闭时报错的bug
~修复安装时同时下载多次的bug
~修复新手引导报错的bug
2020-11-01 11:38:26 +08:00
juewuy
3f8b3944bb 由于新版本核心导致崩溃的严重bug,回退版本到20201026 2020-11-01 09:13:04 +08:00
juewuy
797eb85e47 v1.0.0beta16
~更新Geoip数据库
2020-10-31 12:58:09 +08:00
juewuy
d39e52216b v1.0.0beta16
~更新Geoip数据库
2020-10-31 12:57:42 +08:00
juewuy
5d5ba2a2e1 Merge branch 'master' of https://github.com/juewuy/clash-for-Miwifi into master 2020-10-30 16:21:25 +08:00
juewuy
1afe716ce3 v1.0.0beta15.7
~同步premium最新测试版核心,修复tun模式下回环bug
~优化了本机代理实现方式,增加了选项菜单
~优化了定时任务实现方式,适配更多设备
~优化了配置文件修饰方式
~优化了启动和关闭进程时的检测,修复错误
~优化了非root用户体验
~优化脚本结构
2020-10-30 16:21:09 +08:00
juewuy
e909bec1bb Update README.md 2020-10-30 16:18:48 +08:00
juewuy
c43a927280 v1.0.0beta15.7
~同步premium最新测试版核心,修复tun模式下回环bug
~优化了本机代理实现方式,增加了选项菜单
~优化了定时任务实现方式,适配更多设备
~优化了配置文件修饰方式
~优化了启动和关闭进程时的检测,修复错误
~优化了非root用户体验
~优化脚本结构
2020-10-28 13:56:51 +08:00
juewuy
a0b31a4905 v1.0.0beta15.7
~优化了本机代理实现方式,增加了选项菜单
~优化了定时任务实现方式,适配更多设备
~优化了配置文件修饰方式
~优化了启动和关闭进程时的检测,修复错误
~优化了非root用户体验
~优化脚本结构
2020-10-28 13:49:45 +08:00
juewuy
335c466520 v1.0.0beta15.7
~优化了本机代理实现方式,增加了选项菜单
~优化了定时任务实现方式,适配更多设备
~优化了配置文件修饰方式
~优化了启动和关闭进程时的检测,修复错误
~优化了非root用户体验
~优化脚本结构
2020-10-28 11:09:26 +08:00
juewuy
d9bff51afc v1.0.0beta15.7
~优化了定时任务实现方式,适配更多设备
~优化了配置文件修饰方式
~优化了启动和关闭进程时的检测,修复错误
~优化了非root用户体验
~优化脚本结构
2020-10-27 16:36:01 +08:00
juewuy
d4aba59988 v1.0.0beta15.7
~修改了定时任务实现方式,适配更多设备
~修改了配置文件修饰方式
~优化了非root用户体验
~优化脚本结构
2020-10-27 09:42:12 +08:00
juewuy
f41440a118 v1.0.0beta15.7
~修改了定时任务实现方式,适配更多设备
~修改了配置文件修饰方式
~优化了非root用户体验
~优化脚本结构
2020-10-27 09:40:58 +08:00
juewuy
af6922e2da v1.0.0beta15.6
~Redir模式增加基于tproxy的udp代理
~增加自动生成pac逻辑
~增加Gnome以及KDE桌面的自动设置本机代理功能
~修复各种更新检测失败的bug
~修复关闭时报错的bug
~修复安装时同时下载多次的bug
~修复新手引导报错的bug
2020-10-25 23:17:17 +08:00
juewuy
81d97502e1 v1.0.0beta15.6
~Redir模式增加基于tproxy的udp代理
~增加自动生成pac逻辑
~增加Gnome以及KDE桌面的自动设置本机代理功能
~修复各种更新检测失败的bug
~修复关闭时报错的bug
~修复安装时同时下载多次的bug
~修复新手引导报错的bug
2020-10-25 16:31:30 +08:00
juewuy
c98e69cce6 v1.0.0beta15.6
~Redir模式增加基于tproxy的udp代理
~增加自动生成pac逻辑
~增加Gnome以及KDE桌面的自动设置本机代理功能
~修复各种更新检测失败的bug
~修复关闭时报错的bug
~修复安装时同时下载多次的bug
~修复新手引导报错的bug
2020-10-25 16:31:08 +08:00
juewuy
81159b6176 v1.0.0beta15.6
~Redir模式增加基于tproxy的udp代理
~增加自动生成pac逻辑
~增加Gnome以及KDE桌面的自动设置本机代理功能
~修复各种更新检测失败的bug
~修复关闭时报错的bug
2020-10-25 16:11:45 +08:00
juewuy
d6e532c639 v1.0.0beta15.5
~Redir模式增加基于tproxy的udp代理
~增加自动生成pac逻辑
~增加Gnome以及KDE桌面的自动设置本机代理功能
~修复各种更新检测失败的bug
2020-10-25 15:42:44 +08:00
juewuy
78a3f1d68b v1.0.0beta15.5
~Redir模式增加基于tproxy的udp代理
~增加自动生成pac逻辑
~增加Gnome以及KDE桌面的自动设置本机代理功能
~修复各种更新检测失败的bug
2020-10-25 15:42:23 +08:00
juewuy
0d65f13af9 v1.0.0beta15.5
~Redir模式增加基于tproxy的udp代理
~修复各种更新检测失败的bug
~增加自动生成pac逻辑
2020-10-25 13:48:22 +08:00
juewuy
1b39b2ebd4 v1.0.0beta15.4
~Redir模式增加基于tproxy的udp代理
~修复更新检测失败的bug
2020-10-25 10:01:58 +08:00
juewuy
0f6fc088d8 v1.0.0beta15.3
~优化脚本语句和结构
~完美适配支持wget!!!
~优化非root用户体验
~增加Gitee下载源
~增加脚本日志以及查看日志功能
~修复部分情况下开机自启显示错误的bug
2020-10-24 21:27:13 +08:00
juewuy
de920ddd8a v1.0.0beta15.3
~优化脚本语句和结构
~完美适配支持wget!!!
~优化非root用户体验
~增加Gitee下载源
~增加脚本日志以及查看日志功能
~修复部分情况下开机自启显示错误的bug
2020-10-24 21:13:34 +08:00
juewuy
7091319fcb v1.0.0beta15.3
~优化脚本语句和结构
~完美适配支持wget!!!
~优化非root用户体验
~增加Gitee下载源
~增加脚本日志以及查看日志功能
~修复部分情况下开机自启显示错误的bug
2020-10-24 21:13:06 +08:00
juewuy
4743965c58 v1.0.0beta15.3
~优化脚本语句和结构
~完美适配支持wget!!!
~增加Gitee下载源
~增加脚本日志以及查看日志功能
~修复部分情况下开机自启显示错误的bug
2020-10-24 20:09:49 +08:00
juewuy
c642ca4b8c v1.0.0beta15.3
~优化脚本语句和结构
~增加wget下载方式,统一下载逻辑
~增加Gitee下载源
~增加脚本日志以及查看日志功能
~修复部分情况下开机自启显示错误的bug
2020-10-24 09:54:14 +08:00
juewuy
f72bc273c7 v1.0.0beta15.3
~优化脚本语句和结构
~增加wget下载方式
~修复部分情况下开机自启显示错误的bug
2020-10-23 19:08:35 +08:00
juewuy
a4b84dc55b v1.0.0beta15.2
~新增自定义http/sock5代理认证功能
~新增支持安装内置yacd面板
~增加自定义DNS配置功能
~优化安装脚本
~修复部分设备无法正常显示局域网连接ip/mac的bug
~修复iptables报错的bug
~同步最新版本Geoip数据库文件
2020-10-23 07:23:38 +08:00
juewuy
9e7799981b v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~新增支持安装内置yacd面板
~增加自定义DNS配置功能
~优化安装脚本
~修复部分设备无法正常显示局域网连接ip/mac的bug
~修复iptables报错的bug
~同步最新版本Geoip数据库文件
2020-10-22 20:53:22 +08:00
juewuy
e51069fc79 v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~新增支持安装内置yacd面板
~增加自定义DNS配置功能
~修复部分设备无法正常显示局域网连接ip/mac的bug
~同步最新版本Geoip数据库文件
2020-10-22 13:01:54 +08:00
juewuy
0106db9a92 v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~新增支持安装内置yacd面板
~增加自定义DNS配置功能
~修复部分设备无法正常显示局域网连接ip/mac的bug
~同步最新版本Geoip数据库文件
2020-10-22 13:01:32 +08:00
juewuy
eb094bd40e Merge branch 'master' of https://github.com/juewuy/clash-for-Miwifi into master
# Conflicts:
#	README.md
2020-10-22 00:01:12 +08:00
juewuy
d7d9c6efa7 v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~新增支持安装内置yacd面板
~增加自定义DNS配置功能
~修复fake-ip模式下偶尔会出现大量回环流量的bug
~修复部分设备无法正常显示局域网连接ip/mac的bug
~同步最新版本Geoip数据库文件
2020-10-21 23:57:10 +08:00
juewuy
31160a6ef2 v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~增加自定义DNS配置功能
~修复fake-ip模式下偶尔会出现大量回环流量的bug
~修复部分设备无法正常显示局域网连接ip/mac的bug
2020-10-21 10:54:47 +08:00
juewuy
cbf1a47979 v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~增加自定义DNS配置功能
~修复fake-ip模式下偶尔会出现大量回环流量的bug
2020-10-21 10:53:20 +08:00
juewuy
82c352973f v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~增加自定义DNS配置功能
~修复fake-ip模式下偶尔会出现大量回环流量的bug
2020-10-21 00:42:59 +08:00
juewuy
d69dce0fb4 v1.0.0beta15.1
~新增自定义http/sock5代理认证功能
~增加自定义DNS配置功能
~修复fake-ip模式下偶尔会出现大量回环流量的bug
2020-10-20 11:04:47 +08:00
juewuy
e60b0ad59b Update README.md 2020-10-15 16:40:32 +08:00
juewuy
60bb6da692 v1.0.0beta15
~新增对使用mips-softfloat核心设备的适配
~新增手动指定核心架构的菜单
~增加了按照关键字白名单筛选节点的功能
~新增了帮助:-h,测试:-t脚本运行参数
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~回滚对循环计算的方式
2020-10-14 17:26:41 +08:00
juewuy
6d79038393 Update README.md 2020-10-14 17:25:56 +08:00
juewuy
4079d1525f v1.0.0beta15
~新增对使用mips-softfloat核心设备的适配
~新增手动指定核心架构的菜单
~增加了按照关键字白名单筛选节点的功能
~新增了帮助:-h,测试:-t脚本运行参数
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~回滚对循环计算的方式
2020-10-14 17:22:13 +08:00
juewuy
0219fcd94e v1.0.0beta14fix5
~新增对使用mips-softfloat核心设备的适配
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~回滚对循环计算的方式
2020-10-14 16:19:44 +08:00
juewuy
30b3a34d8e v1.0.0beta14fix4
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~回滚对循环计算的方式
2020-10-14 09:39:42 +08:00
juewuy
8dc3c3fdc2 v1.0.0beta14fix5
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~回滚对循环计算的方式
2020-10-14 09:12:23 +08:00
juewuy
68e7519fdf v1.0.0beta14fix4
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~修复部分设备开机启动显示不正常的bug
~修复部分设备时间显示不正常的bug
2020-10-13 17:25:04 +08:00
juewuy
fd267e6316 v1.0.0beta14fix4
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~修复部分设备开机启动显示不正常的bug
~修复部分设备时间显示不正常的bug
2020-10-13 17:24:29 +08:00
juewuy
c1ac05fd36 v1.0.0beta14fix4
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~修复部分设备开机启动显示不正常的bug
~修复部分设备时间显示不正常的bug
2020-10-13 17:06:21 +08:00
juewuy
fc5dc18348 v1.0.0beta14fix4
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
~修复部分设备开机启动显示不正常的bug
~修复部分设备时间显示不正常的bug
2020-10-12 17:17:30 +08:00
juewuy
94c0ed99ef v1.0.0beta14fix4
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
~优化ipv6dns拦截方式
2020-10-12 16:48:30 +08:00
juewuy
5598809f57 Update README.md 2020-10-12 15:01:35 +08:00
juewuy
9ea1fb7df6 Rename install.sh to install_cdn.sh 2020-10-12 10:40:35 +08:00
juewuy
f607cfbc70 Update install.sh 2020-10-12 10:38:05 +08:00
juewuy
8484ffae3b v1.0.0beta14fix3
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
2020-10-11 21:33:40 +08:00
juewuy
87ae8b78be v1.0.0beta14fix3
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
2020-10-11 21:30:20 +08:00
juewuy
156d9193ee v1.0.0beta14fix2
~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
2020-10-11 13:08:02 +08:00
juewuy
12f3babe47 v1.0.0beta14fix1
~修复部分ssr节点不可用的bug
2020-10-11 00:03:03 +08:00
juewuy
1f00c32e5a v1.0.0beta14
~新增保存面板配置功能(每小时/手动停止服务时自动保存)
~同步最新1.2.0版本clash核心以及pre版核心
~同步最新版GeoIP数据库
~修改导入配置文件时的规则,现在会自动尝试最多5次
~修复了使用systemd无法正常启动进程的bug
~修复了导入未经转换配置文件时报错的bug
~屏蔽了部分已经无法使用的sub后端服务器地址
~修改了本机代理实现方式,现在会随着clash服务停止而取消
2020-10-10 17:07:14 +08:00
juewuy
cd8a885618 v1.0.0beta14
~新增保存面板配置功能(每小时/手动停止服务时自动保存)
~同步最新1.2.0版本clash核心以及pre版核心
~同步最新版GeoIP数据库
~修改导入配置文件时的规则,现在会自动尝试最多5次
~修复了使用systemd无法正常启动进程的bug
~修复了导入未经转换配置文件时报错的bug
~屏蔽了部分已经无法使用的sub后端服务器地址
~修改了本机代理实现方式,现在会随着clash服务停止而取消
2020-10-10 17:02:53 +08:00
juewuy
a33da9f15f v1.0.0beta14
~同步最新1.2.0版本clash核心以及pre版核心
~同步最新版GeoIP数据库
~修复了使用systemd无法正常启动进程的bug
~修复了导入未经转换配置文件时报错的bug
~屏蔽了部分已经无法使用的sub后端服务器地址
~修改了本机代理实现方式,现在会随着clash服务停止而取消
2020-10-10 09:00:23 +08:00
juewuy
cb413622eb v1.0.0beta13fix3
~修复了使用systemd无法正常启动进程的bug
2020-10-09 19:21:28 +08:00
juewuy
420aeeba3d v1.0.0beta13fix2
~修复了导入未经转换配置文件时报错的bug
~屏蔽了部分已经无法使用的sub后端服务器地址
~修改了本机代理实现方式,现在会随着clash服务停止而取消
2020-10-07 16:31:39 +08:00
juewuy
8827f2d561 v1.0.0beta13fix1
~修复了导入未经转换配置文件时报错的bug
~屏蔽了部分已经无法使用的sub后端服务器地址
2020-10-07 11:21:05 +08:00
juewuy
23b8c2265e v1.0.0beta13
~支持Padavan系统(仅保守模式)
~进阶功能菜单增加修改默认端口功能
~优化版本检测机制以及显示效果
~优化定时任务功能,修复部分设备不可用的bug
~优化检测端口占用流程
~优化安装脚本安装流程,支持覆盖安装
~修复部分设备因开启ipv6导致的DNS污染(待测试)
~修复小米R2D等博通芯片设备使用ARMv7核心报错的bug
~修复部分旧设备无法正确显示运行时间的bug
~修复无法正常导入个人更新源的bug
2020-10-06 20:10:07 +08:00
juewuy
6dc8545ddd v1.0.0beta13
~支持Padavan系统(仅保守模式)
~进阶功能菜单增加修改默认端口功能
~优化版本检测机制以及显示效果
~优化定时任务功能,修复部分设备不可用的bug
~优化检测端口占用流程
~优化安装脚本安装流程,支持覆盖安装
~修复部分设备因开启ipv6导致的DNS污染(待测试)
~修复小米R2D等博通芯片设备使用ARMv7核心报错的bug
~修复部分旧设备无法正确显示运行时间的bug
~修复无法正常导入个人更新源的bug
2020-10-06 20:05:07 +08:00
juewuy
dea883c011 v1.0.0beta13
~支持Padavan系统(仅保守模式)
~进阶功能菜单增加修改默认端口功能
~优化版本检测机制以及显示效果
~优化定时任务功能,修复部分设备不可用的bug
~优化检测端口占用流程
~优化安装脚本安装流程,支持覆盖安装
~修复部分设备因开启ipv6导致的DNS污染(待测试)
~修复小米R2D等博通芯片设备使用ARMv7核心报错的bug
~修复部分旧设备无法正确显示运行时间的bug
~修复无法正常导入个人更新源的bug
2020-10-06 17:56:17 +08:00
juewuy
7baff049dc v1.0.0pre1
~增加fake-ip屏蔽域名列表,修复各种fakeip下服务出错
~增加fallbackDNS跳过GeoIPCN,优化响应速度
~使用upx3.9.3版本压缩mipsle核心文件,优化兼容性(待测试)
~调整导入订阅时的提示信息,尽可能减少歧义
~屏蔽导入节点功能,请自行转换配置文件!
~增加新版本clash核心对内置hosts的支持(待测试)
2020-10-03 17:05:11 +08:00
juewuy
78d8c31f57 v1.0.0pre1
~增加fake-ip屏蔽域名列表,修复各种fakeip下服务出错
~增加fallbackDNS跳过GeoIPCN,优化响应速度
~使用upx3.9.3版本压缩mipsle核心文件,优化兼容性(待测试)
~调整导入订阅时的提示信息,尽可能减少歧义
~屏蔽导入节点功能,请自行转换配置文件!
2020-10-03 15:51:14 +08:00
juewuy
c4b8836b6e v1.0.0pre1
~增加fake-ip屏蔽域名列表,修复各种fakeip下服务出错
~增加fallbackDNS跳过GeoIPCN,优化响应速度
~使用upx3.9.3版本压缩mipsle核心文件,优化兼容性(待测试)
~调整导入订阅时的提示信息,尽可能减少歧义
~屏蔽导入节点功能,请自行转换配置文件!
2020-10-02 11:56:42 +08:00
juewuy
da80a6bba8 v1.0.0pre1
~增加fake-ip屏蔽域名列表,修复各种fakeip下服务出错
~增加fallbackDNS跳过GeoIPCN,优化响应速度
~使用upx3.9.3压缩mipsle核心文件,优化兼容性
~调整导入节点时的提示信息,尽可能减少歧义
2020-10-02 11:29:09 +08:00
juewuy
f0d2b7e16c v1.0.0pre1
~增加fake-ip屏蔽域名列表,修复各种fakeip下服务出错
~增加fallbackDNS跳过GeoIPCN,优化响应速度
~不再使用upx压缩mipsle核心文件,优化兼容性
~调整导入节点时的提示信息,尽可能减少歧义
2020-10-02 09:43:46 +08:00
juewuy
3ad9294037 v1.0.0pre1
~增加fake-ip屏蔽域名列表,修复各种fakeip下服务出错
~增加fallbackDNS跳过GeoIPCN,优化响应速度
2020-10-02 09:19:38 +08:00
juewuy
eaac6ea43f v1.0.0beta11
~同步最新GeoIP数据库
~修复启动失败后依然提示服务启动的bug
~屏蔽经常出现的netstat命令提示
~优化节点链接导入功能
~修复部分设备开启ipv6后造成dns污染的问题
~修复cdn更新脚本或核心失败的bug
2020-10-02 09:17:04 +08:00
juewuy
100a32f2a3 Merge branch 'master' of https://github.com/juewuy/clash-for-Miwifi into master 2020-10-02 09:16:27 +08:00
juewuy
d5b1bfa0f5 v1.0.0beta11
~同步最新GeoIP数据库
~修复启动失败后依然提示服务启动的bug
~屏蔽经常出现的netstat命令提示
~优化节点链接导入功能
~修复部分设备开启ipv6后造成dns污染的问题
~修复cdn更新脚本或核心失败的bug
2020-10-02 09:16:12 +08:00
juewuy
0fec04488e Update README.md 2020-10-02 07:36:44 +08:00
juewuy
ac2386be93 v1.0.0beta11
~同步最新GeoIP数据库
~修复启动失败后依然提示服务启动的bug
~屏蔽经常出现的netstat命令提示
~优化节点链接导入功能
~修复部分设备开启ipv6后造成dns污染的问题
2020-10-01 19:17:54 +08:00
juewuy
f16ba5a49d v1.0.0beta11
~同步最新GeoIP数据库
~修复启动失败后依然提示服务启动的bug
~屏蔽经常出现的netstat命令提示
~优化节点链接导入功能
~修复部分设备开启ipv6后造成dns污染的问题
2020-10-01 19:14:29 +08:00
juewuy
b83104a888 v1.0.0beta10fix3
~修复启动失败后依然提示服务启动的bug
~屏蔽经常出现的netstat命令提示
~优化节点链接导入功能
~修复部分设备开启ipv6后造成dns污染的问题
2020-10-01 18:45:26 +08:00
juewuy
e9674a1ca6 v1.0.0beta10fix2
~增加大量订阅内置规则
~修复偶尔无法正常更新的bug
~修复导入订阅时无法正常启动的bug
~修复ac2100核心无法正常工作的bug
~修复切换更新源后无法正常更新的bug
2020-09-29 19:40:07 +08:00
juewuy
29f7ba1518 v1.0.0beta10fix2
~增加大量订阅内置规则
~修复偶尔无法正常更新的bug
~修复导入订阅时无法正常启动的bug
~修复ac2100核心无法正常工作的bug
~修复切换更新源后无法正常更新的bug
2020-09-29 19:31:12 +08:00
juewuy
baf0b1adc5 v1.0.0beta10fix2
~增加大量订阅内置规则
~修复偶尔无法正常更新的bug
~修复导入订阅时无法正常启动的bug
~修复ac2100核心无法正常工作的bug
2020-09-29 19:03:45 +08:00
juewuy
dbe7ca280a v1.0.0beta10fix1
~增加大量订阅内置规则
~修复偶尔无法正常更新的bug
~修复导入订阅时无法正常启动的bug
~修复ac2100核心无法正常工作的bug
2020-09-29 19:02:28 +08:00
juewuy
87e1d5773c v1.0.0beta10
~同步Premium核心版本至20200927
~增加对小米/红米AC2100系列设备的支持
~修复了默认配置设置显示与实际设置不符的bug
2020-09-28 22:05:18 +08:00
juewuy
e78b336edf v1.0.0beta10
~同步Premium核心版本至20200927
~增加对小米/红米AC2100系列设备的支持
~修复了默认配置设置显示与实际设置不符的bug
2020-09-28 21:11:00 +08:00
juewuy
aa2f16a7d9 v1.0.0beta10
~同步Premium核心版本至20200927
~增加对小米/红米AC2100系列设备的支持
~修复了默认配置设置显示与实际设置不符的bug
2020-09-28 21:10:37 +08:00
juewuy
7c18992e9b v1.0.0beta10
~同步Premium核心版本至20200927
~增加对小米/红米AC2100系列设备的支持
~修复了默认配置设置显示与实际设置不符的bug
2020-09-28 21:02:46 +08:00
41 changed files with 6171 additions and 1918 deletions

View File

@@ -1,56 +1,105 @@
# ShellClash原Clash for Miwifi
在Shell环境下一键部署及管理[Clash](https://github.com/Dreamacro/clash)
=====
功能简介:
--
~通过管理脚本在shell环境下便捷使用[Clash](https://github.com/Dreamacro/clash)<br>
~通过管理脚本在Shell环境下便捷使用[Clash](https://github.com/Dreamacro/clash)<br>
~支持在Shell环境下管理[Clash各种功能](https://lancellc.gitbook.io/clash)<br>
~支持批量导入SS/SSR/v2ray/trojan等节点链接及订阅链接<br>~支持配置定时任务,以及定时更新订阅<br>~支持使用以及安装网页面板管理规则组<br>
~支持局域网透明代理/纯净模式等多种模式切换<br>~支持在线更新管理脚本及升级Clash核心<br>
~支持在线导入[Clash](https://github.com/Dreamacro/clash)支持的节点、订阅及配置链接<br>~支持配置定时任务,以及定时更新订阅<br>~支持在线安装及使用网页面板管理规则组<br>
~支持局域网透明代理/纯净模式等多种模式切换<br>~支持GNOME、KDE桌面自动配置本机系统级代理<br>~支持在线更新<br>
设备支持:
--
~支持小米/红米全系使用官方系统或官方开发版系统的路由器设备Ac2100系列除外<br>
~支持小米/红米全系使用官方系统或官方开发版系统的路由器设备<br>
~支持各种基于OpenWrt或使用OpenWrt二次定制开发的路由器设备<br>
~支持各种运行标准Linux系统如Debian/CenOS/Armbian等的设备<br>
~更多设备请提issue或前往TG群反馈需提供设备名称及运行uname -a返回的设备核心信息<br>
~支持各种运行标准Linux系统如Debian/CenOS/Armbian等的设备<br>~兼容Padavan固件保守模式、潘多拉固件<br>——————————
~更多设备支持请提issue或前往TG群反馈需提供设备名称及运行uname -a返回的设备核心信息<br>
使用方式:
--
~确认路由器设备已经开启SSH并获取root权限<br>
~使用SSH连接工具如puttyJuiceSSH系统自带终端等路由器或设备的SSH管理界面并切换到root用户<br>
~在SSH界面执行如下安装命令并按照后续提示完成安装<br>
~确认路由器设备已经开启SSH并获取root权限带GUI桌面的Linux设备可使用自带终端安装<br>
~使用SSH连接工具如puttyJuiceSSH系统自带终端等路由器或Linux设备的SSH管理界面或终端界面并切换到root用户<br>
~确认设备已经安装curl或者wget下载工具。如未安装LInux设备请[参考此处](https://www.howtoing.com/install-curl-in-linux)安装curl基于OpenWrt小米官方系统、潘多拉、高恪等的设备请使用如下命令安装curl<br>
```shell
opkg update && opkg install curl
```
~之后在SSH界面执行如下安装命令并按照后续提示完成安装<br>
~**使用curl安装**<br>
```Shell
#Release版本-github直连
sh -c "$(curl -kfsSl --resolve raw.githubusercontent.com:443:199.232.68.133 https://raw.githubusercontent.com/juewuy/ShellClash/master/install.sh)" && source /etc/profile &> /dev/null
#Release版本-jsdelivrCDN源
sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master/install.sh)" && source /etc/profile &> /dev/null
#Test版本-github直连
sh -c "$(curl -kfsSl --resolve raw.githubusercontent.com:443:199.232.68.133 https://raw.githubusercontent.com/juewuy/ShellClash/master/install.sh)" -s 1 && source /etc/profile &> /dev/null
```
或者
```Shell
sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master/install_cdn.sh)" && source /etc/profile &> /dev/null
~**使用wget安装**<br>
```sh
#Release版本-jsdelivrCDN源
wget -q --no-check-certificate -O /tmp/install.sh https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
```
~安装完成管理脚本后,执行如下命令以运行管理脚本<br>
~**非root用户安装后**请额外执行以下命令以读取环境变量:<br>
```shell
source ~/.bashrc &> /dev/null
```
~安装完成管理脚本后,执行如下命令以**运行管理脚本**<br>
```Shell
clash
clash #正常模式运行
clash -h #脚本帮助及说明
clash -t #测试模式运行
```
~**运行时的额外依赖**<br>
`大部分的设备/系统都已经预装了以下的大部分依赖,使用时如无影响可以无视之`
```sh
bash/ash 必须 全部缺少时无法安装及运行脚本
curl/wget 必须 全部缺少时无法在线安装及更新,无法使用节点保存功能
iptables 重要 缺少时只能使用纯净模式
systemd/rc.common 一般 全部缺少时只能使用保守模式
iptables-mod-nat 一般 缺少时无法使用redir模式混合模式
ip6tables-mod-nat 较低 缺少时影响redir模式混合模式对ipv6的支持
crontab 较低 缺少时无法启用定时任务功能
net-tools 极低 缺少时无法正常检测端口占用
ubus/iproute-doc 极低 缺少时无法正常获取本机host地址
```
更新日志:
--
https://github.com/juewuy/ShellClash/releases
### [点击查看](https://github.com/juewuy/ShellClash/releases)
交流反馈:
--
### https://t.me/clashfm
### [TG讨论组](https://t.me/clashfm)
已知问题
相关Q&A
--
~Tun模式下clash服务可能会和路由器内置的网游加速器冲突请谨慎同时使用<br>
~Redir模式暂不支持转发udp流量外服游戏可能会受影响外服游戏用户建议使用Tun模式<br>
~部分设备长时间使用会出现内存占用偏高——此为golang内存回收不及时导致可以通过屏蔽p2p流量及设置每日定时重启核心以缓解<br>
~节点无法连接——在【clash功能设置】中打开【跳过本地证书验证】或者升级clash核心<br>
### [详见博客](https://juewuy.github.io)
## 捐赠此项目:
### [前往页面](https://juewuy.github.io/yOF4Yf06Q/)
友情推广:
--
https://dler.best/auth/register?affid=89698
### [顶级8K专线机场-墙洞](https://dler.best/auth/register?affid=89698)

Binary file not shown.

3435
bin/ca-certificates.crt Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
version=1.1.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
version=2020.09.27

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
version=1.0.0

BIN
bin/cn_mini.mmdb Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

6
bin/release_version Normal file
View File

@@ -0,0 +1,6 @@
1.0.0beta18
1.0.0beta17
1.0.0beta15
1.0.0beta11
1.0.0beta5
0.9.7

View File

@@ -1,2 +1,4 @@
GeoIP_v=20200917
versionsh=1.0.0beta9fix2
GeoIP_v=20201211
clash_v=1.3.0
clashpre_v=2020.11.20
versionsh=1.0.0beta18fix

BIN
bin/yacd.tar.gz Normal file

Binary file not shown.

View File

@@ -1,8 +1,8 @@
#! /bin/bash
# Copyright (C) Juewuy
echo='echo -e' && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && echo=echo
test=0
echo='echo -e' && [ -n "$(echo -e|grep e)" ] && echo=echo
[ -z "$1" ] && test=0 || test=$1
echo "***********************************************"
echo "** 欢迎使用 **"
@@ -10,26 +10,59 @@ echo "** ShellClash **"
echo "** by Juewuy **"
echo "***********************************************"
url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash"
if [ $test -ge 1 ];then
url="--resolve raw.githubusercontent.com:443:199.232.68.133 https://raw.githubusercontent.com/juewuy/ShellClash/master"
[ $test -ge 2 ] && url="http://192.168.31.30:8080/clash-for-Miwifi"
else
release_new=$(curl -kfsSL --resolve api.github.com:443:140.82.113.5 "https://api.github.com/repos/juewuy/ShellClash/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') #检查版本
#检查root权限
if [ "$USER" != "root" ];then
echo 当前用户:$USER
$echo "\033[31m请尽量使用root用户执行安装!\033[0m"
echo -----------------------------------------------
read -p "仍要安装?可能会产生大量未知错误!(1/0) > " res
[ "$res" != "1" ] && exit
fi
[ -z "$release_new" ] && release_new=$(curl -kfsSL $url/bin/version | grep "versionsh" | awk -F "=" '{print $2}')
webget(){
#参数【$1】代表下载目录【$2】代表在线地址
#参数【$3】代表输出显示【$4】不启用重定向
if curl --version > /dev/null 2>&1;then
[ "$3" = "echooff" ] && progress='-s' || progress='-#'
[ -z "$4" ] && redirect='-L' || redirect=''
result=$(curl -w %{http_code} --connect-timeout 5 $progress $redirect -ko $1 $2)
else
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
[ "$3" = "echoon" ] && progress=''
[ -z "$4" ] && redirect='' || redirect='--max-redirect=0'
wget -Y on $progress $redirect --no-check-certificate --timeout=5 -O $1 $2
[ $? -eq 0 ] && result="200"
fi
}
#检查更新
url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash"
if [ "$test" -gt 0 ];then
url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master"
[ "$test" -eq 2 ] && url="http://192.168.31.31:8080/ShellClash"
[ "$test" -eq 3 ] && url="http://192.168.123.90:8080/clash-for-Miwifi"
else
webget /tmp/clashrelease $url@master/bin/release_version echoon rediroff 2>/tmp/clashrelease
[ "$result" = "200" ] && release_new=$(cat /tmp/clashrelease | head -1)
[ -z "$release_new" ] && release_new=master
url=$url@$release_new
fi
webget /tmp/clashversion $url/bin/version echooff
[ "$result" = "200" ] && versionsh=$(cat /tmp/clashversion | grep "versionsh" | awk -F "=" '{print $2}')
[ -z "$release_new" ] && release_new=$versionsh
rm -rf /tmp/clashversion
rm -rf /tmp/clashrelease
[ -z "$release_new" ] && echo "无法连接服务器!" && exit
tarurl=$url@$release_new/bin/clashfm.tar.gz
[ $test -ge 1 ] && tarurl=$url/bin/clashfm.tar.gz
tarurl=$url/bin/clashfm.tar.gz
gettar(){
result=$(curl -w %{http_code} -kLo /tmp/clashfm.tar.gz $tarurl)
webget /tmp/clashfm.tar.gz $tarurl
[ "$result" != "200" ] && echo "文件下载失败!" && exit 1
#解压
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -----------------------------------------------
echo 开始解压文件!
mkdir -p $clashdir > /dev/null
tar -zxvf '/tmp/clashfm.tar.gz' -C $clashdir/
[ $? -ne 0 ] && echo "文件解压失败!" && exit 1
[ $? -ne 0 ] && echo "文件解压失败!" && rm -rf /tmp/clashfm.tar.gz && exit 1
#初始化文件目录
[ -f "$clashdir/mark" ] || echo '#标识clash运行状态的文件不明勿动' > $clashdir/mark
#判断系统类型写入不同的启动文件
@@ -38,18 +71,17 @@ gettar(){
mv $clashdir/clashservice /etc/init.d/clash
chmod 777 /etc/init.d/clash
else
[ -d /etc/systemd/system ] && sysdir=/etc/systemd/system
[ -d /usr/lib/systemd/system/ ] && sysdir=/usr/lib/systemd/system/
[ -w /etc/systemd/system ] && sysdir=/etc/systemd/system
[ -w /usr/lib/systemd/system ] && sysdir=/usr/lib/systemd/system
if [ -n "$sysdir" ];then
#设为systemd方式启动
mv $clashdir/clash.service $sysdir/clash.service
sed -i "s%/etc/clash%$clashdir%g" $sysdir/clash.service
systemctl daemon-reload
rm -rf /etc/init.d/clash
else
#设为保守模式启动
sed -i '/start_old=*/'d $clashdir/mark
sed -i "1i\start_old=已开启" $clashdir/mark
echo start_old=已开启 >> $clashdir/mark
fi
fi
#修饰文件及版本号
@@ -57,28 +89,41 @@ gettar(){
sed -i "s%#!/bin/sh%#!/bin/$shtype%g" $clashdir/start.sh
chmod 777 $clashdir/start.sh
sed -i '/versionsh_l=*/'d $clashdir/mark
sed -i "1i\versionsh_l=$release_new" $clashdir/mark
echo versionsh_l=$release_new >> $clashdir/mark
#设置环境变量
sed -i '/alias clash=*/'d /etc/profile
echo "alias clash=\"$shtype $clashdir/clash.sh\"" >> /etc/profile #设置快捷命令环境变量
sed -i '/export clashdir=*/'d /etc/profile
echo "export clashdir=\"$clashdir\"" >> /etc/profile #设置clash路径环境变量
[ -w ~/.bashrc ] && profile=~/.bashrc
[ -w /etc/profile ] && profile=/etc/profile
sed -i '/alias clash=*/'d $profile
echo "alias clash=\"$shtype $clashdir/clash.sh\"" >> $profile #设置快捷命令环境变量
sed -i '/export clashdir=*/'d $profile
echo "export clashdir=\"$clashdir\"" >> $profile #设置clash路径环境变量
#删除临时文件
rm -rf /tmp/clashfm.tar.gz
rm -rf $clashdir/clashservice
rm -rf $clashdir/clash.service
}
#输出
$echo "最新版本:\033[32m$release_new\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[44m如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
$echo "\033[37m支持各种基于openwrt的路由器设备"
$echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[32m 1 在默认目录(/etc)安装"
$echo "\033[33m 2 手动设置安装目录"
$echo "\033[0m 0 退出安装"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#下载及安装
install(){
echo -----------------------------------------------
echo 开始从服务器获取安装文件!
echo -----------------------------------------------
gettar
echo -----------------------------------------------
echo ShellClash 已经安装成功!
[ "$USER" != "root" ] && echo "请执行【source ~/.bashrc &> /dev/null】命令以加载环境变量"
echo -----------------------------------------------
$echo "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理\033[0m"
echo -----------------------------------------------
}
setdir(){
echo -----------------------------------------------
$echo "\033[33m安装ShellClash至少需要预留约1MB的磁盘空间\033[0m"
$echo " 1 在\033[32m/etc目录\033[0m下安装(适合路由设备)"
$echo " 2 在\033[32m/usr/share目录\033[0m下安装(适合大多数设备)"
$echo " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)"
$echo " 4 手动设置安装目录"
$echo " 0 退出安装"
echo -----------------------------------------------
read -p "请输入相应数字 > " num
#设置目录
if [ -z $num ];then
@@ -87,29 +132,62 @@ if [ -z $num ];then
elif [ "$num" = "1" ];then
dir=/etc
elif [ "$num" = "2" ];then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dir=/usr/share
elif [ "$num" = "3" ];then
dir=~/.local/share
mkdir -p ~/.config/systemd/user
elif [ "$num" = "4" ];then
echo -----------------------------------------------
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$2}'| sed 1d
df -h | awk '{print $6,$4}'| sed 1d
echo '路径是必须带 / 的格式,写入虚拟内存(/tmp,/sys,..)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir
if [ -z $dir ];then
echo 路径错误!已取消安装!
if [ -z "$dir" ];then
$echo "\033[31m路径错误请重新设置\033[0m"
setdir
fi
else
echo 安装已取消!!!
exit;
fi
if [ ! -w $dir ];then
$echo "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" && sleep 1 && setdir
else
echo 目标目录磁盘剩余:$(df -h $dir | awk '{print $4}' | sed 1d )
read -p "确认安装?(1/0) > " res
[ "$res" = "1" ] && clashdir=$dir/clash || setdir
fi
}
#输出
$echo "最新版本:\033[32m$release_new\033[0m"
echo -----------------------------------------------
$echo "\033[44m如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
$echo "\033[37m支持各种基于openwrt的路由器设备"
$echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m"
if [ -n "$clashdir" ];then
echo -----------------------------------------------
$echo "检测到旧的安装目录\033[36m$clashdir\033[0m是否覆盖安装"
$echo "\033[32m覆盖安装时不会移除配置文件\033[0m"
read -p "覆盖安装/卸载旧版本?(1/0) > " res
if [ "$res" = "1" ];then
install
elif [ "$res" = "0" ];then
rm -rf $clashdir
echo -----------------------------------------------
$echo "\033[31m 旧版本文件已卸载!\033[0m"
setdir
install
elif [ "$res" = "9" ];then
echo 测试模式,变更安装位置
setdir
install
else
$echo "\033[31m输入错误已取消安装\033[0m"
exit;
fi
else
echo 安装已取消
exit;
setdir
install
fi
clashdir=$dir/clash
#输出
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 开始从服务器获取安装文件!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#下载及安装
gettar
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ShellClash 已经安装成功!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -1,115 +0,0 @@
#! /bin/bash
# Copyright (C) Juewuy
echo='echo -e' && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && echo=echo
test=0
echo "***********************************************"
echo "** 欢迎使用 **"
echo "** ShellClash **"
echo "** by Juewuy **"
echo "***********************************************"
url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash"
if [ $test -ge 1 ];then
url="--resolve raw.githubusercontent.com:443:199.232.68.133 https://raw.githubusercontent.com/juewuy/ShellClash/master"
[ $test -ge 2 ] && url="http://192.168.31.30:8080/clash-for-Miwifi"
else
release_new=$(curl -kfsSL --resolve api.github.com:443:140.82.113.5 "https://api.github.com/repos/juewuy/ShellClash/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') #检查版本
fi
[ -z "$release_new" ] && release_new=$(curl -kfsSL $url/bin/version | grep "versionsh" | awk -F "=" '{print $2}')
[ -z "$release_new" ] && echo "无法连接服务器!" && exit
tarurl=$url@$release_new/bin/clashfm.tar.gz
[ $test -ge 1 ] && tarurl=$url/bin/clashfm.tar.gz
gettar(){
result=$(curl -w %{http_code} -kLo /tmp/clashfm.tar.gz $tarurl)
[ "$result" != "200" ] && echo "文件下载失败!" && exit 1
#解压
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 开始解压文件!
mkdir -p $clashdir > /dev/null
tar -zxvf '/tmp/clashfm.tar.gz' -C $clashdir/
[ $? -ne 0 ] && echo "文件解压失败!" && exit 1
#初始化文件目录
[ -f "$clashdir/mark" ] || echo '#标识clash运行状态的文件不明勿动' > $clashdir/mark
#判断系统类型写入不同的启动文件
if [ -f /etc/rc.common ];then
#设为init.d方式启动
mv $clashdir/clashservice /etc/init.d/clash
chmod 777 /etc/init.d/clash
else
[ -d /etc/systemd/system ] && sysdir=/etc/systemd/system
[ -d /usr/lib/systemd/system/ ] && sysdir=/usr/lib/systemd/system/
if [ -n "$sysdir" ];then
#设为systemd方式启动
mv $clashdir/clash.service $sysdir/clash.service
sed -i "s%/etc/clash%$clashdir%g" $sysdir/clash.service
systemctl daemon-reload
rm -rf /etc/init.d/clash
else
#设为保守模式启动
sed -i '/start_old=*/'d $clashdir/mark
sed -i "1i\start_old=已开启" $clashdir/mark
fi
fi
#修饰文件及版本号
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
sed -i "s%#!/bin/sh%#!/bin/$shtype%g" $clashdir/start.sh
chmod 777 $clashdir/start.sh
sed -i '/versionsh_l=*/'d $clashdir/mark
sed -i "1i\versionsh_l=$release_new" $clashdir/mark
#设置环境变量
sed -i '/alias clash=*/'d /etc/profile
echo "alias clash=\"$shtype $clashdir/clash.sh\"" >> /etc/profile #设置快捷命令环境变量
sed -i '/export clashdir=*/'d /etc/profile
echo "export clashdir=\"$clashdir\"" >> /etc/profile #设置clash路径环境变量
#删除临时文件
rm -rf /tmp/clashfm.tar.gz
rm -rf $clashdir/clashservice
rm -rf $clashdir/clash.service
}
#输出
$echo "最新版本:\033[32m$release_new\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[44m如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
$echo "\033[37m支持各种基于openwrt的路由器设备"
$echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[32m 1 在默认目录(/etc)安装"
$echo "\033[33m 2 手动设置安装目录"
$echo "\033[0m 0 退出安装"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
read -p "请输入相应数字 > " num
#设置目录
if [ -z $num ];then
echo 安装已取消
exit;
elif [ "$num" = "1" ];then
dir=/etc
elif [ "$num" = "2" ];then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$2}'| sed 1d
echo '路径是必须带 / 的格式,写入虚拟内存(/tmp,/sys,..)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir
if [ -z $dir ];then
echo 路径错误!已取消安装!
exit;
fi
else
echo 安装已取消
exit;
fi
clashdir=$dir/clash
#输出
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 开始从服务器获取安装文件!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#下载及安装
gettar
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ShellClash 已经安装成功!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -1,115 +0,0 @@
#! /bin/bash
# Copyright (C) Juewuy
echo='echo -e' && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && echo=echo
test=1
echo "***********************************************"
echo "** 欢迎使用 **"
echo "** ShellClash **"
echo "** by Juewuy **"
echo "***********************************************"
url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash"
if [ $test -ge 1 ];then
url="--resolve raw.githubusercontent.com:443:199.232.68.133 https://raw.githubusercontent.com/juewuy/ShellClash/master"
[ $test -ge 2 ] && url="http://192.168.31.30:8080/clash-for-Miwifi"
else
release_new=$(curl -kfsSL --resolve api.github.com:443:140.82.113.5 "https://api.github.com/repos/juewuy/ShellClash/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') #检查版本
fi
[ -z "$release_new" ] && release_new=$(curl -kfsSL $url/bin/version | grep "versionsh" | awk -F "=" '{print $2}')
[ -z "$release_new" ] && echo "无法连接服务器!" && exit
tarurl=$url@$release_new/bin/clashfm.tar.gz
[ $test -ge 1 ] && tarurl=$url/bin/clashfm.tar.gz
gettar(){
result=$(curl -w %{http_code} -kLo /tmp/clashfm.tar.gz $tarurl)
[ "$result" != "200" ] && echo "文件下载失败!" && exit 1
#解压
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 开始解压文件!
mkdir -p $clashdir > /dev/null
tar -zxvf '/tmp/clashfm.tar.gz' -C $clashdir/
[ $? -ne 0 ] && echo "文件解压失败!" && exit 1
#初始化文件目录
[ -f "$clashdir/mark" ] || echo '#标识clash运行状态的文件不明勿动' > $clashdir/mark
#判断系统类型写入不同的启动文件
if [ -f /etc/rc.common ];then
#设为init.d方式启动
mv $clashdir/clashservice /etc/init.d/clash
chmod 777 /etc/init.d/clash
else
[ -d /etc/systemd/system ] && sysdir=/etc/systemd/system
[ -d /usr/lib/systemd/system/ ] && sysdir=/usr/lib/systemd/system/
if [ -n "$sysdir" ];then
#设为systemd方式启动
mv $clashdir/clash.service $sysdir/clash.service
sed -i "s%/etc/clash%$clashdir%g" $sysdir/clash.service
systemctl daemon-reload
rm -rf /etc/init.d/clash
else
#设为保守模式启动
sed -i '/start_old=*/'d $clashdir/mark
sed -i "1i\start_old=已开启" $clashdir/mark
fi
fi
#修饰文件及版本号
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
sed -i "s%#!/bin/sh%#!/bin/$shtype%g" $clashdir/start.sh
chmod 777 $clashdir/start.sh
sed -i '/versionsh_l=*/'d $clashdir/mark
sed -i "1i\versionsh_l=$release_new" $clashdir/mark
#设置环境变量
sed -i '/alias clash=*/'d /etc/profile
echo "alias clash=\"$shtype $clashdir/clash.sh\"" >> /etc/profile #设置快捷命令环境变量
sed -i '/export clashdir=*/'d /etc/profile
echo "export clashdir=\"$clashdir\"" >> /etc/profile #设置clash路径环境变量
#删除临时文件
rm -rf /tmp/clashfm.tar.gz
rm -rf $clashdir/clashservice
rm -rf $clashdir/clash.service
}
#输出
$echo "最新版本:\033[32m$release_new\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[44m如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
$echo "\033[37m支持各种基于openwrt的路由器设备"
$echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[32m 1 在默认目录(/etc)安装"
$echo "\033[33m 2 手动设置安装目录"
$echo "\033[0m 0 退出安装"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
read -p "请输入相应数字 > " num
#设置目录
if [ -z $num ];then
echo 安装已取消
exit;
elif [ "$num" = "1" ];then
dir=/etc
elif [ "$num" = "2" ];then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$2}'| sed 1d
echo '路径是必须带 / 的格式,写入虚拟内存(/tmp,/sys,..)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir
if [ -z $dir ];then
echo 路径错误!已取消安装!
exit;
fi
else
echo 安装已取消
exit;
fi
clashdir=$dir/clash
#输出
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 开始从服务器获取安装文件!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#下载及安装
gettar
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ShellClash 已经安装成功!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$echo "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

File diff suppressed because it is too large Load Diff

View File

@@ -5,15 +5,21 @@ START=92
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
USE_PROCD=1
DIR=$(cat /etc/profile|grep clashdir|awk -F "\"" '{print $2}')
#获取目录
DIR=$(cat /etc/profile | grep clashdir | awk -F "\"" '{print $2}')
[ -z "$DIR" ] && DIR=$(cat ~/.bashrc | grep clashdir | awk -F "\"" '{print $2}')
BINDIR=$(cat $DIR/mark | grep bindir | awk -F "=" '{print $2}')
[ -z "$BINDIR" ] && BINDIR=$DIR
start_service() {
#检测必须文件
$DIR/start.sh bfstart
#使用procd创建clash后台进程
procd_open_instance
procd_set_param respawn
procd_set_param stderr 1
procd_set_param stdout 1
procd_set_param command $DIR/clash -d $DIR
procd_set_param command $BINDIR/clash -d $BINDIR
procd_close_instance
#其他设置
$DIR/start.sh afstart
@@ -21,12 +27,14 @@ start_service() {
start() {
if [ -z "$(pidof procd)" ];then
#检测必须文件
$DIR/start.sh bfstart
#创建后台进程
service_start $DIR/clash -d $DIR
#设置守护进程
$DIR/start.sh deamon
service_start $BINDIR/clash -d $BINDIR
#其他设置
$DIR/start.sh afstart
#设置守护进程
$DIR/start.sh deamon
else
start_service
fi

File diff suppressed because it is too large Load Diff

View File

@@ -1,217 +1,278 @@
#!/bin/sh
# Copyright (C) Juewuy
#脚本内部工具
getconfig(){
#加载环境变量
[ -z "$clashdir" ] && source /etc/profile > /dev/null 2>&1
ccfg=$clashdir/mark
#检查/读取标识文件
[ ! -f $ccfg ]&& echo '#标识clash运行状态的文件不明勿动' >> $ccfg
source $ccfg
#默认设置
[ -z "$skip_cert" ] && skip_cert=已开启
[ -z "$common_ports" ] && common_ports=已开启
[ -z "$dns_mod" ] && dns_mod=redir_host
[ -z "$dns_over" ] && dns_over=已开启
[ -z "$modify_yaml" ] && modify_yaml=未开启
[ -z "$ipv6_support" ] && ipv6_support=开启
[ -z "$start_old" ] && start_old=未开启
[ -z "$local_proxy" ] && local_proxy=未开启
#是否代理常用端口
[ "$common_ports" = "已开启" ] && ports='-m multiport --dports 22,53,587,465,995,993,143,80,443 '
#检测系统端口占用
for portx in 1053 7890 7892 9999 ;do
[ -n "$(netstat -ntulp |grep :$portx|grep -v clash)" ] && echo -e "检测到端口:\033[30;47m $portx \033[0m被以下进程占用clash无法启动" && echo $(netstat -ntulp |grep :$portx) && exit;
done
#加载配置文件
[ -z "$clashdir" ] && clashdir=$(cat /etc/profile | grep clashdir | awk -F "\"" '{print $2}')
[ -z "$clashdir" ] && clashdir=$(cat ~/.bashrc | grep clashdir | awk -F "\"" '{print $2}')
ccfg=$clashdir/mark
[ -f $ccfg ] && source $ccfg
#默认设置
[ -z "$bindir" ] && bindir=$clashdir
[ -z "$redir_mod" ] && [ "$USER" = "root" -o "$USER" = "admin" ] && redir_mod=Redir模式
[ -z "$redir_mod" ] && redir_mod=Redir模式
[ -z "$skip_cert" ] && skip_cert=已开启
[ -z "$common_ports" ] && common_ports=已开启
[ -z "$dns_mod" ] && dns_mod=redir_host
[ -z "$dns_over" ] && dns_over=开启
[ -z "$modify_yaml" ] && modify_yaml=未开启
[ -z "$ipv6_support" ] && ipv6_support=未开启
[ -z "$start_old" ] && start_old=未开启
[ -z "$local_proxy" ] && local_proxy=未开启
[ -z "$mix_port" ] && mix_port=7890
[ -z "$redir_port" ] && redir_port=7892
[ -z "$db_port" ] && db_port=9999
[ -z "$dns_port" ] && dns_port=1053
[ -z "$dns_nameserver" ] && dns_nameserver='114.114.114.114, 223.5.5.5'
[ -z "$dns_fallback" ] && dns_fallback='1.0.0.1, 8.8.4.4'
[ -z "$multiport" ] && multiport='53,587,465,995,993,143,80,443'
#是否代理常用端口
[ "$common_ports" = "已开启" ] && ports="-m multiport --dports $multiport"
}
setconfig(){
#参数1代表变量名参数2代表变量值,参数3即文件路径
[ -z "$3" ] && configpath=$clashdir/mark || configpath=$3
[ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
}
getyaml(){
#前后端订阅服务器地址索引,可在此处添加!
Server=`sed -n ""$server_link"p"<<EOF
subconverter-web.now.sh
subconverter.herokuapp.com
subcon.py6.pw
api.dler.io
api.wcc.best
skapi.cool
EOF`
Config=`sed -n ""$rule_link"p"<<EOF
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiMode.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_AdblockPlus.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_AdblockPlus.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoAuto.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_NoAuto.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Netflix.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_AdblockPlus.ini
EOF`
#如果传来的是Url链接则合成Https链接否则直接使用Https链接
if [ -z $Https ];then
#echo $Url
Https="https://$Server/sub?target=clashr&insert=true&new_name=true&scv=true&exclude=$exclude&url=$Url&config=$Config"
markhttp=1
fi
#
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 正在连接服务器获取配置文件…………链接地址为:
echo -e "\033[4;32m$Https\033[0m"
echo 可以手动复制该链接到浏览器打开并查看数据是否正常!
echo -e "\033[36m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo -e "| |"
echo -e "| 需要一点时间,请耐心等待! |"
echo -e "| \033[0m如长时间没有数据请用ctrl+c退出\033[36m |"
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\033[0m"
#获取在线yaml文件
yaml=$clashdir/config.yaml
yamlnew=/tmp/config.yaml
rm -rf $yamlnew > /dev/null 2>&1
result=$(curl -w %{http_code} -kLo $yamlnew $Https)
if [ "$result" != "200" ];then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[31m配置文件获取失败\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo
if [ -z $markhttp ];then
echo 请尝试使用导入节点/链接功能!
getlink
compare(){
if [ ! -f $1 -o ! -f $2 ];then
return 1
elif command -v cmp >/dev/null 2>&1;then
cmp -s $1 $2
else
read -p "是否更换后端地址后重试?[1/0] > " res
if [ "$res" = '1' ]; then
sed -i '/server_link=*/'d $ccfg
if [[ $server_link -ge 6 ]]; then
server_link=0
fi
server_link=$(($server_link + 1))
echo $server_link
sed -i "1i\server_link=$server_link" $ccfg
Https=""
getyaml
fi
#exit;
[ "$(cat $1)" = "$(cat $2)" ] && return 0 || return 1
fi
else
Https=""
if cat $yamlnew | grep ', server:' >/dev/null;then
#检测旧格式
if cat $yamlnew | grep 'Proxy Group:' >/dev/null;then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[31m已经停止对旧格式配置文件的支持\033[0m"
echo -e "请使用新格式或者使用\033[32m导入节点/订阅\033[0m功能"
sleep 2
clashlink
fi
#检测不支持的加密协议
if cat $yamlnew | grep 'cipher: chacha20,' >/dev/null;then
if [ "$clashcore" = "clash" -o "$clashcore" = "clashpre" ];then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[31m当前核心$clashcore不支持chacha20加密\033[0m"
echo -e "请更换使用clashR核心"
sleep 2
getcore
fi
fi
#替换文件
[ -f $yaml ] && mv $yaml $yaml.bak
mv $yamlnew $yaml
echo 配置文件已生成正在启动clash使其生效
#重启clash服务
$0 stop
$0 start
sleep 1
if pidof clash >/dev/null;then
start_over
}
webget(){
[ -n "$(pidof clash)" ] && export all_proxy="http://$authentication@127.0.0.1:$mix_port" #设置临时http代理
#参数【$1】代表下载目录【$2】代表在线地址
#参数【$3】代表输出显示【$4】不启用重定向
#参数【$5】代表验证证书
if curl --version > /dev/null 2>&1;then
[ "$3" = "echooff" ] && progress='-s' || progress='-#'
[ "$4" = "rediroff" ] && redirect='' || redirect='-L'
[ "$5" = "skipceroff" ] && certificate='' || certificate='-k'
result=$(curl -w %{http_code} --connect-timeout 3 $progress $redirect $certificate -o $1 $2)
[ "$result" != "200" ] && export all_proxy="" && result=$(curl -w %{http_code} --connect-timeout 3 $progress $redirect $certificate -o $1 $2)
else
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
[ "$3" = "echoon" ] && progress=''
[ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
[ "$5" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate'
wget -Y on $progress $redirect $certificate --timeout=3 -O $1 $2
if [ "$?" != "0" ];then
wget $progress $redirect $certificate --timeout=3 -O $1 $2
[ "$?" = "0" ] && result="200"
else
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if [ -f $yaml.bak ];then
$clashdir/start.sh stop
mv $yaml.bak $yaml
$0 start
echo -e "\033[31mclash服务启动失败已还原配置文件并重启clash\033[0m"
sleep 1
if pidof clash >/dev/null;then
start_over
exit;
fi
fi
echo -e "\033[31mclash服务启动失败请查看报错信息\033[0m"
$0 stop
$clashdir/clash -t -d $clashdir
exit;
result="200"
fi
else
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[33m获取到了配置文件但格式似乎不对\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sed -n '1,30p' $yamlnew
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[33m请检查如上配置文件信息:\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fi
#exit;
fi
#exit
export all_proxy=""
}
modify_yaml(){
##########需要变更的配置###########
mix='mixed-port: 7890'
redir='redir-port: 7892'
lan='allow-lan: true'
mode='mode: Rule'
log='log-level: info'
if [ "$ipv6_support" = "已开启" ];then
ipv6='ipv6: true'
else
ipv6='ipv6: false'
fi
external='external-controller: 0.0.0.0:9999'
if [ -d $clashdir/ui ];then
external_ui='external-ui: ui'
else
external_ui='external-ui:'
fi
if [ "$dns_mod" = "fake-ip" ];then
dns='dns: {enable: true, listen: 0.0.0.0:1053, fake-ip-range: 198.18.0.1/16, enhanced-mode: fake-ip, nameserver: [114.114.114.114, 127.0.0.1:53], fallback: [tcp://1.0.0.1, 8.8.4.4]}'
elif [ "$dns_over" = "已开启" ];then
dns='dns: {enable: true, ipv6: true, listen: 0.0.0.0:1053, enhanced-mode: redir-host, nameserver: [114.114.114.114, 223.5.5.5], fallback: [1.0.0.1, 8.8.4.4]}'
else
dns='dns: {enable: true, ipv6: true, listen: 0.0.0.0:1053, enhanced-mode: redir-host, nameserver: [114.114.114.114, 223.5.5.5, 127.0.0.1:53], fallback: [1.0.0.1, 8.8.4.4]}'
fi
if [ "$redir_mod" != "Redir模式" ];then
tun='tun: {enable: true, stack: system}'
else
tun='tun: {enable: false}'
fi
exper='experimental: {ignore-resolve-fail: true, interface-name: en0}'
###################################
#预删除需要添加的项目
i=$(grep -n "^proxies:" $clashdir/config.yaml | head -1 | cut -d ":" -f 1)
i=$(($i-1))
sed -i "1,${i}d" $clashdir/config.yaml
#添加配置
sed -i "1i$mix" $clashdir/config.yaml
sed -i "1a$redir" $clashdir/config.yaml
sed -i "2a$lan" $clashdir/config.yaml
sed -i "3a$mode" $clashdir/config.yaml
sed -i "4a$log" $clashdir/config.yaml
sed -i "5a$ipv6" $clashdir/config.yaml
sed -i "6a$external" $clashdir/config.yaml
sed -i "7a$external_ui" $clashdir/config.yaml
sed -i "8a$dns" $clashdir/config.yaml
sed -i "9a$tun" $clashdir/config.yaml
sed -i "10a$exper" $clashdir/config.yaml
#跳过本地tls证书验证
if [ "$skip_cert" = "已开启" ];then
sed -i '10,99s/skip-cert-verify: false/skip-cert-verify: true/' $clashdir/config.yaml
else
sed -i '10,99s/skip-cert-verify: true/skip-cert-verify: false/' $clashdir/config.yaml
fi
logger(){
[ -n "$2" ] && echo -e "\033[$2m$1\033[0m"
echo `date "+%G-%m-%d %H:%M:%S"` $1 >> $clashdir/log
[ "$(wc -l $clashdir/log | awk '{print $1}')" -gt 30 ] && sed -i '1,5d' $clashdir/log
}
cronset(){
# 参数1代表要移除的关键字,参数2代表要添加的任务语句
crondir=/tmp/cron_$USER
crontab -l > $crondir
sed -i "/$1/d" $crondir
echo "$2" >> $crondir
crontab $crondir
rm -f $crondir
}
mark_time(){
start_time=`date +%s`
sed -i '/start_time*/'d $clashdir/mark
sed -i "1i\start_time=$start_time" $clashdir/mark
echo start_time=$start_time >> $clashdir/mark
}
#配置文件相关
getyaml(){
[ -z "$rule_link" ] && rule_link=1
[ -z "$server_link" ] && server_link=1
#前后端订阅服务器地址索引,可在此处添加!
Server=`sed -n ""$server_link"p"<<EOF
subcon.dlj.tf
subconverter.herokuapp.com
subconverter-web.now.sh
api.dler.io
api.wcc.best
EOF`
Config=`sed -n ""$rule_link"p"<<EOF
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiMode.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_AdblockPlus.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_AdblockPlus.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Netflix.ini
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_AdblockPlus.ini
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_clash.ini
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_dler.ini
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/connershua_pro.ini
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/connershua_backtocn.ini
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/dlercloud_lige_platinum.ini
https://subconverter.oss-ap-southeast-1.aliyuncs.com/Rules/RemoteConfig/special/basic.ini
https://subconverter.oss-ap-southeast-1.aliyuncs.com/Rules/RemoteConfig/special/netease.ini
EOF`
#如果传来的是Url链接则合成Https链接否则直接使用Https链接
if [ -z "$Https" ];then
Https="https://$Server/sub?target=clash&insert=true&new_name=true&scv=true&exclude=$exclude&include=$include&url=$Url&config=$Config"
markhttp=1
fi
#输出
echo -----------------------------------------------
echo 正在连接服务器获取配置文件…………链接地址为:
echo -e "\033[4;32m$Https\033[0m"
echo 可以手动复制该链接到浏览器打开并查看数据是否正常!
#获取在线yaml文件
yaml=$clashdir/config.yaml
yamlnew=/tmp/clash_config_$USER.yaml
rm -rf $yamlnew
webget $yamlnew $Https
if [ "$result" != "200" ];then
if [ -z "$markhttp" ];then
echo -----------------------------------------------
logger "配置文件获取失败!" 31
echo -e "\033[31m请尝试使用【导入订阅】功能\033[0m"
echo -----------------------------------------------
exit 1
else
if [ "$retry" -ge 5 ];then
logger "无法获取配置文件,请检查链接格式以及网络连接状态!" 31
exit 1
else
retry=$((retry+1))
logger "配置文件获取失败!" 31
echo -e "\033[32m尝试使用其他服务器获取配置\033[0m"
logger "正在重试第$retry次/共5次" 32
sed -i '/server_link=*/'d $ccfg
if [ "$server_link" -ge 5 ]; then
server_link=0
fi
server_link=$((server_link+1))
echo server_link=$server_link >> $ccfg
Https=""
getyaml
fi
fi
else
Https=""
#检测节点或providers
if [ -z "$(cat $yamlnew | grep -E 'server:|proxy-providers:' | grep -v 'nameserver')" ];then
echo -----------------------------------------------
logger "获取到了配置文件,但似乎并不包含正确的节点信息!" 31
echo -----------------------------------------------
sed -n '1,30p' $yamlnew
echo -----------------------------------------------
echo -e "\033[33m请检查如上配置文件信息:\033[0m"
echo -----------------------------------------------
exit 1
fi
#检测旧格式
if cat $yamlnew | grep 'Proxy Group:' >/dev/null;then
echo -----------------------------------------------
logger "已经停止对旧格式配置文件的支持!!!" 31
echo -e "请使用新格式或者使用【导入节点/链接】功能!"
echo -----------------------------------------------
exit 1
fi
#检测不支持的加密协议
if cat $yamlnew | grep 'cipher: chacha20,' >/dev/null;then
echo -----------------------------------------------
logger "已停止支持chacha20加密请更换更安全的节点加密协议" 31
echo -----------------------------------------------
exit 1
fi
#使用核心内置test功能检测
if [ -x $bindir/clash ];then
$bindir/clash -t -d $bindir -f $yamlnew >/dev/null
if [ "$?" != "0" ];then
logger "配置文件加载失败!请查看报错信息!" 31
$bindir/clash -t -d $bindir -f $yamlnew
echo "$($bindir/clash -t -d $bindir -f $yamlnew)" >> $clashdir/log
exit 1
fi
fi
#如果不同则备份并替换文件
if [ -f $yaml ];then
compare $yamlnew $yaml
[ "$?" = 0 ] || mv -f $yaml $yaml.bak && mv -f $yamlnew $yaml
else
mv -f $yamlnew $yaml
fi
echo -e "\033[32m已成功获取配置文件\033[0m"
rm -rf $yamlnew
exit 0
fi
}
modify_yaml(){
##########需要变更的配置###########
lan='allow-lan: true'
mode='mode: Rule'
log='log-level: info'
[ "$ipv6_support" = "已开启" ] && ipv6='ipv6: true' || ipv6='ipv6: false'
external="external-controller: 0.0.0.0:$db_port"
[ -d $clashdir/ui ] && db_ui=ui
[ "$redir_mod" != "Redir模式" ] && tun='tun: {enable: true, stack: system}' || tun='tun: {enable: false}'
exper='experimental: {ignore-resolve-fail: true, interface-name: en0}'
#dns配置
if [ "$dns_mod" = "fake-ip" ];then
dns='dns: {enable: true, listen: 0.0.0.0:'$dns_port', use-hosts: true, fake-ip-range: 198.18.0.1/16, enhanced-mode: fake-ip, fake-ip-filter: ["*.lan", "time.windows.com", "time.nist.gov", "time.apple.com", "time.asia.apple.com", "*.ntp.org.cn", "*.openwrt.pool.ntp.org", "time1.cloud.tencent.com", "time.ustc.edu.cn", "pool.ntp.org", "ntp.ubuntu.com", "ntp.aliyun.com", "ntp1.aliyun.com", "ntp2.aliyun.com", "ntp3.aliyun.com", "ntp4.aliyun.com", "ntp5.aliyun.com", "ntp6.aliyun.com", "ntp7.aliyun.com", "time1.aliyun.com", "time2.aliyun.com", "time3.aliyun.com", "time4.aliyun.com", "time5.aliyun.com", "time6.aliyun.com", "time7.aliyun.com", "*.time.edu.cn", "time1.apple.com", "time2.apple.com", "time3.apple.com", "time4.apple.com", "time5.apple.com", "time6.apple.com", "time7.apple.com", "time1.google.com", "time2.google.com", "time3.google.com", "time4.google.com", "music.163.com", "*.music.163.com", "*.126.net", "musicapi.taihe.com", "music.taihe.com", "songsearch.kugou.com", "trackercdn.kugou.com", "*.kuwo.cn", "api-jooxtt.sanook.com", "api.joox.com", "joox.com", "y.qq.com", "*.y.qq.com", "streamoc.music.tc.qq.com", "mobileoc.music.tc.qq.com", "isure.stream.qqmusic.qq.com", "dl.stream.qqmusic.qq.com", "aqqmusic.tc.qq.com", "amobile.music.tc.qq.com", "*.xiami.com", "*.music.migu.cn", "music.migu.cn", "*.msftconnecttest.com", "*.msftncsi.com", "localhost.ptlogin2.qq.com", "*.*.*.srv.nintendo.net", "*.*.stun.playstation.net", "xbox.*.*.microsoft.com", "*.*.xboxlive.com", "proxy.golang.org"], nameserver: ['$dns_nameserver', 127.0.0.1:53], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}'
else
dns='dns: {enable: true, ipv6: true, listen: 0.0.0.0:'$dns_port', use-hosts: true, enhanced-mode: redir-host, nameserver: ['$dns_nameserver$dns_local'], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}'
fi
#设置目录
yaml=$clashdir/config.yaml
tmpdir=/tmp/clash_$USER
#预删除需要添加的项目
a=$(grep -n "port:" $yaml | head -1 | cut -d ":" -f 1)
b=$(grep -n "^prox" $yaml | head -1 | cut -d ":" -f 1)
b=$((b-1))
mkdir -p $tmpdir > /dev/null
sed "${a},${b}d" $yaml > $tmpdir/proxy.yaml
#跳过本地tls证书验证
[ "$skip_cert" = "已开启" ] && sed -i '10,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/proxy.yaml
#添加配置
###################################
cat > $tmpdir/set.yaml <<EOF
mixed-port: $mix_port
redir-port: $redir_port
authentication: ["$authentication"]
$lan
$mode
$log
$ipv6
external-controller: :$db_port
external-ui: $db_ui
secret: $secret
$tun
$exper
$dns
EOF
###################################
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml
#合并文件
cut -c 1- $tmpdir/set.yaml $yaml_user $tmpdir/proxy.yaml > $tmpdir/config.yaml
#插入自定义规则
if [ -f $clashdir/rules.yaml ];then
while read line;do
[ -z "$(echo "$line" | grep '#')" ] && \
[ -n "$(echo "$line" | grep '\-\ ')" ] && \
sed -i "/$line/d" $tmpdir/config.yaml && \
sed -i "/^rules:/a\ $line" $tmpdir/config.yaml
done < $clashdir/rules.yaml
fi
#如果没有使用小闪存模式
if [ "$tmpdir" != "$bindir" ];then
compare $tmpdir/config.yaml $yaml
[ "$?" != 0 ] && mv -f $tmpdir/config.yaml $yaml || rm -f $tmpdir/config.yaml
fi
rm -f $tmpdir/set.yaml
rm -f $tmpdir/proxy.yaml
}
#设置路由规则
start_redir(){
#流量过滤规则
iptables -t nat -N clash
@@ -223,122 +284,347 @@ start_redir(){
iptables -t nat -A clash -d 192.168.0.0/16 -j RETURN
iptables -t nat -A clash -d 224.0.0.0/4 -j RETURN
iptables -t nat -A clash -d 240.0.0.0/4 -j RETURN
for mac in $(cat $clashdir/mac); do
iptables -t nat -A clash -m mac --mac-source $mac -j RETURN
done
#设置防火墙流量转发
iptables -t nat -A clash -p tcp $ports-j REDIRECT --to-ports 7892
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
#mac白名单
for mac in $(cat $clashdir/mac); do
iptables -t nat -A clash -p tcp $ports -m mac --mac-source $mac -j REDIRECT --to-ports $redir_port
done
else
#mac黑名单
for mac in $(cat $clashdir/mac); do
iptables -t nat -A clash -m mac --mac-source $mac -j RETURN
done
iptables -t nat -A clash -p tcp $ports -j REDIRECT --to-ports $redir_port
fi
iptables -t nat -A PREROUTING -p tcp -j clash
#设置ipv6转发
if [ "$ipv6_support" = "已开启" ];then
ip6tables -t nat -N clash
for mac in $(cat $clashdir/mac); do
ip6tables -t nat -A clash -m mac --mac-source $mac -j RETURN
done
ip6tables -t nat -A clash -p tcp $ports-j REDIRECT --to-ports 7892
ip6tables -t nat -A PREROUTING -p tcp -j clash
ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')
if [ -n "$ip6_nat" -a "$ipv6_support" = "已开启" ];then
ip6tables -t nat -N clashv6
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
#mac白名单
for mac in $(cat $clashdir/mac); do
ip6tables -t nat -A clashv6 -p tcp $ports -m mac --mac-source $mac -j REDIRECT --to-ports $redir_port
done
else
#mac黑名单
for mac in $(cat $clashdir/mac); do
ip6tables -t nat -A clashv6 -m mac --mac-source $mac -j RETURN
done
ip6tables -t nat -A clashv6 -p tcp $ports -j REDIRECT --to-ports $redir_port
fi
ip6tables -t nat -A PREROUTING -p tcp -j clashv6
fi
}
stop_iptables(){
#重置iptables规则
iptables -t nat -D PREROUTING -p tcp -j clash > /dev/null 2>&1
iptables -t nat -D PREROUTING -p udp -j clash_dns > /dev/null 2>&1
iptables -t nat -D PREROUTING -p tcp -d 8.8.8.8 -j clash_dns > /dev/null 2>&1
iptables -t nat -D PREROUTING -p tcp -d 8.8.4.4 -j clash_dns > /dev/null 2>&1
iptables -t nat -F clash > /dev/null 2>&1
iptables -t nat -X clash > /dev/null 2>&1
iptables -t nat -F clash_dns > /dev/null 2>&1
iptables -t nat -X clash_dns > /dev/null 2>&1
#重置ipv6规则
ip6tables -t nat -D PREROUTING -p tcp -j clash > /dev/null 2>&1
ip6tables -t nat -D PREROUTING -p udp -j clash_dns > /dev/null 2>&1
ip6tables -t nat -F clash > /dev/null 2>&1
ip6tables -t nat -X clash > /dev/null 2>&1
ip6tables -t nat -F clash_dns > /dev/null 2>&1
ip6tables -t nat -X clash_dns > /dev/null 2>&1
}
start_dns(){
#允许tun网卡接受流量
iptables -I FORWARD -o utun -j ACCEPT
ip6tables -I FORWARD -o utun -j ACCEPT > /dev/null 2>&1
if [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ];then
iptables -I FORWARD -o utun -j ACCEPT
[ "$ipv6_support" = "已开启" ] && ip6tables -I FORWARD -o utun -j ACCEPT > /dev/null 2>&1
fi
#设置dns转发
iptables -t nat -N clash_dns
for mac in $(cat $clashdir/mac); do
iptables -t nat -A clash_dns -m mac --mac-source $mac -j RETURN
done
iptables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to 1053
iptables -t nat -A clash_dns -p tcp --dport 53 -j REDIRECT --to 1053
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
#mac白名单
for mac in $(cat $clashdir/mac); do
iptables -t nat -A clash_dns -p udp --dport 53 -m mac --mac-source $mac -j REDIRECT --to $dns_port
iptables -t nat -A clash_dns -p tcp --dport 53 -m mac --mac-source $mac -j REDIRECT --to $dns_port
done
else
#mac黑名单
for mac in $(cat $clashdir/mac); do
iptables -t nat -A clash_dns -m mac --mac-source $mac -j RETURN
done
iptables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to $dns_port
iptables -t nat -A clash_dns -p tcp --dport 53 -j REDIRECT --to $dns_port
fi
iptables -t nat -A PREROUTING -p udp -j clash_dns
#Google home DNS特殊处理
iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j clash_dns
iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j clash_dns
#ipv6DNS
ip6tables -t nat -N clash_dns > /dev/null 2>&1
for mac in $(cat $clashdir/mac); do
ip6tables -t nat -A clash_dns -m mac --mac-source $mac -j RETURN > /dev/null 2>&1
ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')
if [ -n "$ip6_nat" ];then
ip6tables -t nat -N clashv6_dns > /dev/null 2>&1
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
#mac白名单
for mac in $(cat $clashdir/mac); do
ip6tables -t nat -A clashv6_dns -p udp --dport 53 -m mac --mac-source $mac -j REDIRECT --to $dns_port
ip6tables -t nat -A clashv6_dns -p tcp --dport 53 -m mac --mac-source $mac -j REDIRECT --to $dns_port
done
else
#mac黑名单
for mac in $(cat $clashdir/mac); do
ip6tables -t nat -A clashv6_dns -m mac --mac-source $mac -j RETURN
done
ip6tables -t nat -A clashv6_dns -p udp --dport 53 -j REDIRECT --to $dns_port
ip6tables -t nat -A clashv6_dns -p tcp --dport 53 -j REDIRECT --to $dns_port
fi
ip6tables -t nat -A PREROUTING -p udp -j clashv6_dns
else
ip6tables -I INPUT -p tcp --dport 53 -j REJECT > /dev/null 2>&1
ip6tables -I INPUT -p udp --dport 53 -j REJECT > /dev/null 2>&1
fi
}
start_udp(){
ip rule add fwmark 1 table 100
ip route add local default dev lo table 100
iptables -t mangle -N clash
iptables -t mangle -A clash -d 0.0.0.0/8 -j RETURN
iptables -t mangle -A clash -d 10.0.0.0/8 -j RETURN
iptables -t mangle -A clash -d 127.0.0.0/8 -j RETURN
iptables -t mangle -A clash -d 169.254.0.0/16 -j RETURN
iptables -t mangle -A clash -d 172.16.0.0/12 -j RETURN
iptables -t mangle -A clash -d 192.168.0.0/16 -j RETURN
iptables -t mangle -A clash -d 224.0.0.0/4 -j RETURN
iptables -t mangle -A clash -d 240.0.0.0/4 -j RETURN
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
#mac白名单
for mac in $(cat $clashdir/mac); do
iptables -t mangle -A clash -p udp -m mac --mac-source $mac -j TPROXY --on-port $redir_port --tproxy-mark 1
done
else
#mac黑名单
for mac in $(cat $clashdir/mac); do
iptables -t mangle -A clash -m mac --mac-source $mac -j RETURN
done
iptables -t mangle -A clash -p udp -j TPROXY --on-port $redir_port --tproxy-mark 1
fi
iptables -t mangle -A PREROUTING -p udp -j clash
}
stop_iptables(){
#重置iptables规则
ip rule del fwmark 1 table 100 2> /dev/null
ip route del local default dev lo table 100 2> /dev/null
iptables -t nat -D PREROUTING -p tcp -j clash 2> /dev/null
iptables -t nat -D PREROUTING -p udp -j clash_dns 2> /dev/null
iptables -t nat -D PREROUTING -p tcp -d 8.8.8.8 -j clash_dns 2> /dev/null
iptables -t nat -D PREROUTING -p tcp -d 8.8.4.4 -j clash_dns 2> /dev/null
iptables -t nat -F clash 2> /dev/null
iptables -t nat -X clash 2> /dev/null
iptables -t nat -F clash_dns 2> /dev/null
iptables -t nat -X clash_dns 2> /dev/null
iptables -D FORWARD -o utun -j ACCEPT 2> /dev/null
#重置udp规则
iptables -t mangle -D PREROUTING -p udp -j clash 2> /dev/null
iptables -t mangle -F clash 2> /dev/null
iptables -t mangle -X clash 2> /dev/null
#重置ipv6规则
ip6tables -t nat -D PREROUTING -p tcp -j clashv6 2> /dev/null
ip6tables -t nat -D PREROUTING -p udp -j clashv6_dns 2> /dev/null
ip6tables -t nat -F clashv6 2> /dev/null
ip6tables -t nat -X clashv6 2> /dev/null
ip6tables -t nat -F clashv6_dns 2> /dev/null
ip6tables -t nat -X clashv6_dns 2> /dev/null
ip6tables -D FORWARD -o utun -j ACCEPT 2> /dev/null
}
#面板配置保存相关
web_save(){
get_save(){
if curl --version > /dev/null 2>&1;then
curl -s -H "Authorization: Bearer ${secret}" -H "Content-Type:application/json" "$1"
elif [ -n "$(wget --help 2>&1|grep '\-\-method')" ];then
wget -q --header="Authorization: Bearer ${secret}" --header="Content-Type:application/json" -O - "$1"
else
logger 当前系统未安装curl且wget的版本太低无法保存节点配置 31
getconfig
cronset '保存节点配置'
fi
}
#使用get_save获取面板节点设置
get_save http://localhost:${db_port}/proxies | awk -F "{" '{for(i=1;i<=NF;i++) print $i}' | grep -E '^"all".*"Selector"' > /tmp/clash_web_check_$USER
while read line ;do
def=$(echo $line | awk -F "[\[,]" '{print $2}')
now=$(echo $line | grep -oE '"now".*",' | sed 's/"now"://g'| sed 's/,//g')
[ "$def" != "$now" ] && echo $line | grep -oE '"name".*"now".*",' | sed 's/"name"://g' | sed 's/"now"://g'| sed 's/"//g' >> /tmp/clash_web_save_$USER
done < /tmp/clash_web_check_$USER
rm -rf /tmp/clash_web_check_$USER
#对比文件,如果有变动且不为空则写入磁盘,否则清除缓存
if [ -s /tmp/clash_web_save_$USER ];then
compare /tmp/clash_web_save_$USER $clashdir/web_save
[ "$?" = 0 ] && rm -rf /tmp/clash_web_save_$USER || mv -f /tmp/clash_web_save_$USER $clashdir/web_save
fi
}
web_restore(){
put_save(){
if curl --version > /dev/null 2>&1;then
curl -sS -X PUT -H "Authorization: Bearer ${secret}" -H "Content-Type:application/json" "$1" -d "$2" >/dev/null
else
wget -q --method=PUT --header="Authorization: Bearer ${secret}" --header="Content-Type:application/json" --body-data="$2" "$1" >/dev/null
fi
}
#设置循环检测clash面板端口
i=1
while [ $i -lt 10 ];do
sleep 1
if curl --version > /dev/null 2>&1;then
test=$(curl -s http://localhost:${db_port})
else
test=$(wget -q -O - http://localhost:${db_port})
fi
[ -n "$test" ] && i=10
done
#发送数据
num=$(cat $clashdir/web_save | wc -l)
for i in `seq $num`;
do
group_name=$(awk -F ',' 'NR=="'${i}'" {print $1}' $clashdir/web_save | sed 's/ /%20/g')
now_name=$(awk -F ',' 'NR=="'${i}'" {print $2}' $clashdir/web_save)
put_save http://localhost:${db_port}/proxies/${group_name} "{\"name\":\"${now_name}\"}"
done
ip6tables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to 1053 > /dev/null 2>&1
ip6tables -t nat -A PREROUTING -p udp -j clash_dns > /dev/null 2>&1
}
checkcron(){
[ -d /etc/crontabs/ ]&&cronpath="/etc/crontabs/root"
[ -d /var/spool/cron/ ]&&cronpath="/var/spool/cron/root"
[ -d /var/spool/cron/crontabs/ ]&&cronpath="/var/spool/cron/crontabs/root"
[ -z $cronpath ]&&echo "找不到定时任务文件,无法添加定时任务!"
#启动相关
catpac(){
host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
[ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '192.|10.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
[ -z "$host" ] && host=127.0.0.1
cat > /tmp/clash_pac <<EOF
function FindProxyForURL(url, host) {
if (
isInNet(host, "0.0.0.0", "255.0.0.0")||
isInNet(host, "10.0.0.0", "255.0.0.0")||
isInNet(host, "127.0.0.0", "255.0.0.0")||
isInNet(host, "224.0.0.0", "224.0.0.0")||
isInNet(host, "240.0.0.0", "240.0.0.0")||
isInNet(host, "172.16.0.0", "255.240.0.0")||
isInNet(host, "192.168.0.0", "255.255.0.0")||
isInNet(host, "169.254.0.0", "255.255.0.0")
)
return "DIRECT";
else
return "PROXY 192.168.31.1:7890; DIRECT; SOCKS5 192.168.31.1:7890"
}
daemon(){
checkcron
echo '*/1 * * * * test -z "$(pidof clash)" && /etc/init.d/clash restart #clash守护进程' >> $cronpath
chmod 600 $cronpath
EOF
compare /tmp/clash_pac $bindir/ui/pac
[ "$?" = 0 ] && rm -rf /tmp/clash_pac || mv -f /tmp/clash_pac $bindir/ui/pac
}
afstart(){
bfstart(){
#读取配置文件
getconfig
#修改iptables规则使流量进入clash
stop_iptables
[ "$redir_mod" != "纯净模式" ] && start_dns
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
#标记启动时间
mark_time
[ ! -d $bindir/ui ] && mkdir -p $bindir/ui
[ -z "$update_url" ] && update_url=https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master
#检查clash核心
if [ ! -f $bindir/clash ];then
if [ -f $clashdir/clash ];then
mv $clashdir/clash $bindir/clash && chmod +x $bindir/clash
else
logger "未找到clash核心正在下载" 33
if [ -z "$clashcore" ];then
[ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ] && clashcore=clashpre || clashcore=clash
fi
[ -z "$cpucore" ] && source $clashdir/getdate.sh && getcpucore
[ -z "$cpucore" ] && logger 找不到设备的CPU信息请手动指定处理器架构类型 31 && setcpucore
webget $bindir/clash "$update_url/bin/$clashcore/clash-linux-$cpucore"
[ "$?" = 1 ] && logger "核心下载失败,已退出!" 31 && rm -f $bindir/clash && exit 1
[ ! -x $bindir/clash ] && chmod +x $bindir/clash #检测可执行权限
clashv=$($bindir/clash -v | awk '{print $2}')
setconfig clashv $clashv
fi
fi
#检查数据库文件
if [ ! -f $bindir/Country.mmdb ];then
if [ -f $clashdir/Country.mmdb ];then
mv $clashdir/Country.mmdb $bindir/Country.mmdb
else
logger "未找到GeoIP数据库正在下载" 33
[ -z "$geotype" ] && geotype=cn_mini.mmdb
webget $bindir/Country.mmdb $update_url/bin/$geotype
[ "$?" = 1 ] && logger "数据库下载失败,已退出!" 31 && rm -f $bindir/Country.mmdb && exit 1
Geo_v=$(date +"%Y%m%d")
setconfig Geo_v $Geo_v
fi
fi
#检查dashboard文件
if [ -f $clashdir/ui/index.html -a ! -f $bindir/ui/index.html ];then
cp -rf $clashdir/ui $bindir
fi
catpac #生成pac文件
#检查yaml配置文件
if [ ! -f $clashdir/config.yaml ];then
if [ -n "$Url" -o -n "$Https" ];then
logger "未找到配置文件,正在下载!" 33
getyaml
exit 0
else
logger "未找到配置文件链接,请先导入配置文件!" 31
exit 1
fi
fi
}
afstart(){
#读取配置文件
getconfig
$bindir/clash -t -d $bindir >/dev/null
if [ "$?" = 0 ];then
#设置iptables转发规则
[ "$redir_mod" != "纯净模式" ] && [ "$dns_no" != "已禁用" ] && start_dns
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
[ "$redir_mod" = "Redir模式" ] && [ "$tproxy_mod" = "已开启" ] && start_udp
#标记启动时间
mark_time
#设置本机代理
[ "$local_proxy" = "已开启" ] && $0 set_proxy $mix_port $db_port
#启用面板配置自动保存
cronset '#每10分钟保存节点配置' "*/10 * * * * test -n \"$(pidof clash)\" && $clashdir/start.sh web_save #每10分钟保存节点配置"
[ -f $clashdir/web_save ] && web_restore & #后台还原面板配置
else
logger "clash服务启动失败请查看报错信息" 31
$bindir/clash -t -d $bindir
echo "$($bindir/clash -t -d $bindir)" >> $clashdir/log
$0 stop
exit 1
fi
}
start_old(){
#使用传统后台执行二进制文件的方式执行
$bindir/clash -d $bindir >/dev/null &
afstart
$0 daemon
}
case "$1" in
bfstart)
bfstart
;;
afstart)
afstart
;;
start)
#读取配置文件
[ -n "$(pidof clash)" ] && $0 stop #禁止多实例
getconfig
#检测必须文件并下载
bfstart
stop_iptables #清理iptables
#使用内置规则强行覆盖config配置文件
[ "$modify_yaml" != "已开启" ] && modify_yaml
#使用不同方式启动clash服务
if [ "$start_old" = "已开启" ];then
$clashdir/clash -d $clashdir >/dev/null 2>&1 &
daemon
afstart
start_old
elif [ -f /etc/rc.common ];then
/etc/init.d/clash start
else
elif [ "$USER" = "root" ];then
systemctl start clash.service
else
start_old
fi
;;
stop)
#删除守护
checkcron
sed -i /clash守护进程/d $cronpath >/dev/null 2>&1
getconfig
[ -n "$(pidof clash)" ] && web_save #保存面板配置
#删除守护进程&面板配置自动保存
cronset "clash保守模式守护进程"
cronset "保存节点配置"
#多种方式结束进程
if [ -f /etc/rc.common ];then
/etc/init.d/clash stop >/dev/null 2>&1
else
elif [ "$USER" = "root" ];then
systemctl stop clash.service >/dev/null 2>&1
fi
killall -9 clash >/dev/null 2>&1
#清理iptables
stop_iptables
PID=$(pidof clash) && [ -n "$PID" ] && kill -9 $PID >/dev/null 2>&1
stop_iptables #清理iptables
[ "$local_proxy" = "已开启" ] && $0 unset_proxy #禁用本机代理
;;
restart)
$0 stop
@@ -348,8 +634,54 @@ getyaml)
getconfig
getyaml
;;
daemon)
daemon
updateyaml)
$0 getyaml
$0 restart
;;
webget)
webget $2 $3 $4 $5
;;
web_save)
getconfig
web_save
;;
daemon)
getconfig
cronset '#clash保守模式守护进程' "*/1 * * * * test -z \"$(pidof clash)\" && $clashdir/start.sh restart #clash保守模式守护进程"
;;
set_proxy)
getconfig
#GNOME配置
if [ "$local_proxy_type" = "GNOME" ];then
gsettings set org.gnome.system.proxy autoconfig-url "http://127.0.0.1:$db_port/ui/pac"
gsettings set org.gnome.system.proxy mode "auto"
#KDE配置
elif [ "$local_proxy_type" = "KDE" ];then
kwriteconfig5 --file kioslaverc --group "Proxy Settings" --key "Proxy Config Script" "http://127.0.0.1:$db_port/ui/pac"
kwriteconfig5 --file kioslaverc --group "Proxy Settings" --key "ProxyType" 2
#环境变量方式
else
[ -w ~/.bashrc ] && profile=~/.bashrc
[ -w /etc/profile ] && profile=/etc/profile
echo 'export all_proxy=http://127.0.0.1:'"$mix_port" >> $profile
echo 'export ALL_PROXY=$all_proxy' >> $profile
fi
;;
unset_proxy)
#GNOME配置
if gsettings --version >/dev/null 2>&1 ;then
gsettings set org.gnome.system.proxy mode "none"
fi
#KDE配置
if kwriteconfig5 -h >/dev/null 2>&1 ;then
kwriteconfig5 --file kioslaverc --group "Proxy Settings" --key "ProxyType" 0
fi
#环境变量方式
[ -w ~/.bashrc ] && profile=~/.bashrc
[ -w /etc/profile ] && profile=/etc/profile
sed -i '/all_proxy/'d $profile
sed -i '/ALL_PROXY/'d $profile
;;
esac
#exit 0
exit 0