22 Commits

Author SHA1 Message Date
juewuy
82ba1447e1 已修改 bin/release_version 2020-12-21 21:34:07 +08:00
juewuy
5dc3b53e6e 已修改 README.md
已修改        README_CN.md
2020-12-21 13:31:46 +08:00
juewuy
e5c4e65812 已修改 README.md
已修改        README_CN.md
2020-12-21 13:27:18 +08:00
juewuy
4285663e55 已修改 README_CN.md 2020-12-21 13:26:15 +08:00
juewuy
54b66f0925 Update README.md 2020-12-21 13:24:25 +08:00
juewuy
cfd1b98bd2 已修改 README.md 2020-12-21 13:23:16 +08:00
juewuy
862e5f54fc Update README.md 2020-12-21 13:18:43 +08:00
juewuy
db43540735 Update README.md 2020-12-21 13:16:17 +08:00
juewuy
e048261914 Update README.md 2020-12-21 13:15:46 +08:00
juewuy
bfb57cd094 Update README.md 2020-12-21 13:15:15 +08:00
juewuy
3cab521370 Update README.md 2020-12-21 13:13:27 +08:00
juewuy
e76a62c76f Update README.md 2020-12-21 13:12:34 +08:00
juewuy
75d121d01a 更新Readme 2020-12-21 13:11:33 +08:00
juewuy
6f978ac58f 更新Readme 2020-12-21 13:09:38 +08:00
juewuy
9772fdee87 更新Readme 2020-12-21 13:08:14 +08:00
juewuy
2e3fefe854 更新Readme 2020-12-21 13:06:57 +08:00
juewuy
d26fbe5046 更新Readme 2020-12-21 13:06:04 +08:00
juewuy
e11e883ffd 更新Readme 2020-12-21 12:37:31 +08:00
juewuy
a8b485bd7d v1.0.0beta18.2
~修复部分情况下首次安装本地面板报错的bug
~修复卸载时无法正确移除定时任务的bug
2020-12-21 11:56:05 +08:00
juewuy
5f5d384d53 v1.0.0beta18.2
~修复部分情况下首次安装本地面板报错的bug
~修复卸载时无法正确移除定时任务的bug
2020-12-21 11:55:43 +08:00
juewuy
38efeb7aef v1.0.0beta18.1
~同步最新版本GeoIP数据库文件
~下载本地根证书功能增加自动检测证书目录逻辑
~现在导入包含高级版规则的配置时,会自动切换到高级版核心
2020-12-18 13:00:36 +08:00
juewuy
fea5673384 v1.0.0beta18.1
~下载本地根证书功能增加自动检测证书目录逻辑
~现在导入包含高级版规则的配置时,会自动切换到高级版核心
2020-12-18 12:58:41 +08:00
9 changed files with 220 additions and 88 deletions

119
README.md
View File

@@ -1,105 +1,108 @@
<h1 align="center">
<img src="https://github.com/Dreamacro/clash/raw/master/docs/logo.png" alt="Clash" width="200">
<br>ShellClash<br>
</h1>
# ShellClash原Clash for Miwifi <p align="center">
<a target="_blank" href="https://github.com/Dreamacro/clash/releases">
<img src="https://img.shields.io/github/release/Dreamacro/Clash.svg?style=flat-square&label=Clash">
</a>
<a target="_blank" href="https://github.com/juewuy/ShellClash/releases">
<img src="https://img.shields.io/github/release/juewuy/ShellClash.svg?style=flat-square&label=ShellClash&colorB=green">
</a>
</p>
在Shell环境下一键部署及管理[Clash](https://github.com/Dreamacro/clash) [中文](README_CN.md) | English
=====
功能简介: ## Function introduction:
--
~通过管理脚本在Shell环境下便捷使用[Clash](https://github.com/Dreamacro/clash)<br>
~支持在Shell环境下管理[Clash各种功能](https://lancellc.gitbook.io/clash)<br>
~支持在线导入[Clash](https://github.com/Dreamacro/clash)支持的节点、订阅及配置链接<br>~支持配置定时任务,以及定时更新订阅<br>~支持在线安装及使用网页面板管理规则组<br>
~支持局域网透明代理/纯净模式等多种模式切换<br>~支持GNOME、KDE桌面自动配置本机系统级代理<br>~支持在线更新<br>
设备支持: ~Convenient use in Shell environment through management script [Clash](https://github.com/Dreamacro/clash)<br>~Support management of [Clash functions](https://lancellc.gitbook.io/clash)<br>~Support online import [Clash](https://github.com/Dreamacro/clash) supports sharing, subscription and configuration links<br>~Support configuration timing tasks, support configuration file timing updates<br>~Support online installation and Use local web panel to manage built-in rules<br>~Support routing mode, native mode and other mode switching<br>~Support GNOME, KDE desktop automatic configuration native mode<br>~Support online update<br>
## Equipment support:
~Support various router devices based on OpenWrt or secondary custom development using OpenWrt<br>~Support various devices running standard Linux systems (such as Debian/CenOS/Armbian, etc.)<br>~Compatible with Padavan firmware (conservative mode), Pandora firmware<br>~Compatible with various types of devices customized and developed using the Linux kernel<br>——————————<br>~For more device support, please submit an issue or go to the TG group for feedback (the device name and the device core information returned by running uname -a must be provided)<br>
How to use:
-- --
~支持小米/红米全系使用官方系统或官方开发版系统的路由器设备<br> ~Confirm that the router device has enabled SSH and obtained root privileges (Linux devices with GUI desktops can be installed using their own terminal)<br>~Use SSH connection tools (such as putty, JuiceSSH, system built-in terminal, etc.) router or Linux device SSH management interface or terminal interface, and switch to the root user<br>~Confirm that the curl or wget download tool has been installed on the device. If not installed, please [refer to here](https://www.howtoforge.com/install-curl-in-linux) for LInux devices to install curl. For devices based on OpenWrt (Xiaomi official system, Pandora, Gaoke, etc.), please Use the following command to install curl:<br>
~支持各种基于OpenWrt或使用OpenWrt二次定制开发的路由器设备<br>
~支持各种运行标准Linux系统如Debian/CenOS/Armbian等的设备<br>~兼容Padavan固件保守模式、潘多拉固件<br>——————————
~更多设备支持请提issue或前往TG群反馈需提供设备名称及运行uname -a返回的设备核心信息<br>
使用方式: ```sh
--
~确认路由器设备已经开启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 opkg update && opkg install curl
``` ```
~之后在SSH界面执行如下安装命令并按照后续提示完成安装<br> ~ Then execute the following installation commands on the SSH interface, and follow the subsequent prompts to complete the installation<br>
~**使用curl安装**<br> ##### ~Use curl:<br>
```Shell ```Shell
#Release版本-github直连 #Release version - by 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 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 #Release version - by jsdelivrCDN
sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master/install.sh)" && source /etc/profile &> /dev/null sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master/install.sh)" && source /etc/profile &> /dev/null
#Test版本-github直连 #Test version - by 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 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
``` ```
~**使用wget安装**<br> ##### ~Use wget<br>
```sh ```sh
#Release版本-jsdelivrCDN #Release version - by 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 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
``` ```
~**非root用户安装后**请额外执行以下命令以读取环境变量:<br> ~**After installation by non-root users**, please execute the following additional commands to read environment variables:<br>
```shell ```shell
source ~/.bashrc &> /dev/null source ~/.bashrc &> /dev/null
``` ```
~安装完成管理脚本后,执行如下命令以**运行管理脚本**<br> ~After installing the management script, execute the following command to **run the management script**<br>
```Shell ```Shell
clash #正常模式运行 clash #normal mode
clash -h #脚本帮助及说明 clash -h #help
clash -t #测试模式运行 clash -t #test mode
``` ```
~**运行时的额外依赖**<br> ~**Additional dependencies at runtime**<br>
`大部分的设备/系统都已经预装了以下的大部分依赖,使用时如无影响可以无视之` ```
Most of the equipment/systems are pre-installed with most of the following dependencies, you can ignore them if there is no impact when you use them.
```
```sh ```sh
bash/ash 必须 全部缺少时无法安装及运行脚本 bash/ash necessary Cannot install and run scripts when all are missing
curl/wget 必须 全部缺少时无法在线安装及更新,无法使用节点保存功能 curl/wget necessary When all are missing, it cannot be installed and updated online
iptables 重要 缺少时只能使用纯净模式 iptables important Only use pure mode when missing
systemd/rc.common 一般 全部缺少时只能使用保守模式 systemd/rc.common general Only use conservative mode when all are missing
iptables-mod-nat 一般 缺少时无法使用redir模式混合模式 iptables-mod-nat general Cannot use redir mode, mixed mode when missing
ip6tables-mod-nat 较低 缺少时影响redir模式混合模式对ipv6的支持 ip6tables-mod-nat lower Affects redir mode when missing, mixed mode support for ipv6
crontab 较低 缺少时无法启用定时任务功能 crontab lower Cannot enable timing task function when missing
net-tools 极低 缺少时无法正常检测端口占用 net-tools minimal Cannot detect port occupancy normally when missing
ubus/iproute-doc 极低 缺少时无法正常获取本机host地址 ubus/iproute-doc minimal The host address of the machine cannot be obtained normally when missing
``` ```
更新日志: ## Update log:
--
### [点击查看](https://github.com/juewuy/ShellClash/releases) ### [Click to view](https://github.com/juewuy/ShellClash/releases)
交流反馈: ## Exchange feedback:
--
### [TG讨论组](https://t.me/clashfm)
相关Q&A ### [TG Discussion Group](https://t.me/clashfm)
--
### [详见博客](https://juewuy.github.io) ## Related Q&A:
## 捐赠此项目: ### [See blog for details](https://juewuy.github.io)
### [前往页面](https://juewuy.github.io/yOF4Yf06Q/) ## Donate this project
### [Go to page](https://juewuy.github.io/yOF4Yf06Q/)
## Friendly promotion:
### [Top 8K Airport-Dler](https://dler.best/auth/register?affid=89698)
友情推广:
--
### [顶级8K专线机场-墙洞](https://dler.best/auth/register?affid=89698)

117
README_CN.md Normal file
View File

@@ -0,0 +1,117 @@
<h1 align="center">
<img src="https://github.com/Dreamacro/clash/raw/master/docs/logo.png" alt="Clash" width="200">
<br>ShellClash<br>
</h1>
<p align="center">
<a target="_blank" href="https://github.com/Dreamacro/clash/releases">
<img src="https://img.shields.io/github/release/Dreamacro/Clash.svg?style=flat-square&label=Clash">
</a>
<a target="_blank" href="https://github.com/juewuy/ShellClash/releases">
<img src="https://img.shields.io/github/release/juewuy/ShellClash.svg?style=flat-square&label=ShellClash&colorB=green">
</a>
</p>
中文 | [English](README.md)
功能简介:
--
~通过管理脚本在Shell环境下便捷使用[Clash](https://github.com/Dreamacro/clash)<br>
~支持在Shell环境下管理[Clash各种功能](https://lancellc.gitbook.io/clash)<br>
~支持在线导入[Clash](https://github.com/Dreamacro/clash)支持的分享、订阅及配置链接<br>~支持配置定时任务,支持配置文件定时更新<br>~支持在线安装及使用本地网页面板管理内置规则<br>
~支持路由模式、本机模式等多种模式切换<br>~支持GNOME、KDE桌面自动配置本机模式<br>~支持在线更新<br>
设备支持:
--
~支持各种基于OpenWrt或使用OpenWrt二次定制开发的路由器设备<br>
~支持各种运行标准Linux系统如Debian/CenOS/Armbian等的设备<br>~兼容Padavan固件保守模式、潘多拉固件<br>~兼容各类使用Linux内核定制开发的各类型设备<br>
——————————<br>
~更多设备支持请提issue或前往TG群反馈需提供设备名称及运行uname -a返回的设备核心信息<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
```
~**使用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
```
~**非root用户安装后**请额外执行以下命令以读取环境变量:<br>
```shell
source ~/.bashrc &> /dev/null
```
~安装完成管理脚本后,执行如下命令以**运行管理脚本**<br>
```Shell
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)
交流反馈:
--
### [TG讨论组](https://t.me/clashfm)
相关Q&A
--
### [详见博客](https://juewuy.github.io)
## 捐赠此项目:
### [前往页面](https://juewuy.github.io/yOF4Yf06Q/)
友情推广:
--
### [顶级8K专线机场-墙洞](https://dler.best/auth/register?affid=89698)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

@@ -1,4 +1,4 @@
1.0.0beta18 1.0.0beta18.2
1.0.0beta17 1.0.0beta17
1.0.0beta15 1.0.0beta15
1.0.0beta11 1.0.0beta11

View File

@@ -1,4 +1,4 @@
GeoIP_v=20201211
clash_v=1.3.0 clash_v=1.3.0
clashpre_v=2020.11.20 clashpre_v=2020.11.20
versionsh=1.0.0beta18fix GeoIP_v=20201218
versionsh=1.0.0beta18.2

View File

@@ -646,13 +646,15 @@ getcrt(){
fi fi
} }
setcrt(){ setcrt(){
crtdir='/etc/ssl/certs/ca-certificates.crt' openssldir=$(openssl version -a 2>&1 | grep OPENSSLDIR | awk -F "\"" '{print $2}')
if [ -n "$openssldir" ];then
crtdir="$openssldir/certs/ca-certificates.crt"
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[36m安装/更新本地根证书文件(ca-certificates.crt)\033[0m" echo -e "\033[36m安装/更新本地根证书文件(ca-certificates.crt)\033[0m"
echo -e "\033[33m用于解决证书校验错误x509报错等问题\033[0m" echo -e "\033[33m用于解决证书校验错误x509报错等问题\033[0m"
echo -e "\033[31m无上述问题的设备无需使用本功能\033[0m" echo -e "\033[31m无上述问题的设备请勿使用\033[0m"
[ -f "$crtdir" ] && echo -e "\033[32m当前设备已经安装根证书文件了\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
[ -f "$crtdir" ] && echo -e "\033[33m检测到系统已经安装根证书文件了\033[0m\n-----------------------------------------------"
read -p "确认安装?(1/0) > " res read -p "确认安装?(1/0) > " res
if [ -z "$res" ];then if [ -z "$res" ];then
@@ -660,15 +662,14 @@ setcrt(){
elif [ "$res" = '0' ]; then elif [ "$res" = '0' ]; then
i= i=
elif [ "$res" = '1' ]; then elif [ "$res" = '1' ]; then
if [ -d /etc/ssl/certs ];then
getcrt getcrt
else else
echo ----------------------------------------------- errornum
echo -e "\033[33m设备可能未安装openssl或者证书文件目录不是/etc/ssl/certs无法安装\033[0m"
sleep 1
fi fi
else else
errornum echo -----------------------------------------------
echo -e "\033[33m设备可能尚未安装openssl无法安装证书文件\033[0m"
sleep 1
fi fi
} }
setserver(){ setserver(){
@@ -819,19 +820,19 @@ update(){
read -p "确认卸载ShellClash警告该操作不可逆[1/0] " res read -p "确认卸载ShellClash警告该操作不可逆[1/0] " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
$clashdir/start.sh stop $clashdir/start.sh stop
rm -rf $clashdir $clashdir/start.sh cronset "clash服务"
rm -rf /etc/init.d/clash $clashdir/start.sh cronset "订阅链接"
rm -rf /etc/systemd/system/clash.service
rm -rf /usr/lib/systemd/system/clash.service
rm -rf /www/clash
[ -w ~/.bashrc ] && profile=~/.bashrc [ -w ~/.bashrc ] && profile=~/.bashrc
[ -w /etc/profile ] && profile=/etc/profile [ -w /etc/profile ] && profile=/etc/profile
sed -i '/alias clash=*/'d $profile sed -i '/alias clash=*/'d $profile
sed -i '/export clashdir=*/'d $profile sed -i '/export clashdir=*/'d $profile
sed -i '/all_proxy/'d $profile sed -i '/all_proxy/'d $profile
sed -i '/ALL_PROXY/'d $profile sed -i '/ALL_PROXY/'d $profile
cronset "clash服务" rm -rf $clashdir
cronset "订阅链接" rm -rf /etc/init.d/clash
rm -rf /etc/systemd/system/clash.service
rm -rf /usr/lib/systemd/system/clash.service
rm -rf /www/clash
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[36m已卸载ShellClash相关文件有缘再会\033[0m" echo -e "\033[36m已卸载ShellClash相关文件有缘再会\033[0m"
echo -e "\033[33m请手动关闭当前窗口以重置环境变量\033[0m" echo -e "\033[33m请手动关闭当前窗口以重置环境变量\033[0m"
@@ -918,14 +919,14 @@ userguide(){
echo -e "\033[33m安装本地Dashboard面板可以更快捷的管理clash内置规则\033[0m" echo -e "\033[33m安装本地Dashboard面板可以更快捷的管理clash内置规则\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
read -p "需要安装本地Dashboard面板吗(1/0) > " res read -p "需要安装本地Dashboard面板吗(1/0) > " res
[ "$res" = 1 ] && setdb [ "$res" = 1 ] && checkupdate && setdb
#检测及下载根证书 #检测及下载根证书
if [ -d /etc/ssl/certs -a ! -f '/etc/ssl/certs/ca-certificates.crt' ];then if [ -d /etc/ssl/certs -a ! -f '/etc/ssl/certs/ca-certificates.crt' ];then
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[33m当前设备未找到根证书文件\033[0m" echo -e "\033[33m当前设备未找到根证书文件\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
read -p "是否下载并安装根证书?(1/0) > " res read -p "是否下载并安装根证书?(1/0) > " res
[ "$res" = 1 ] && getcrt [ "$res" = 1 ] && checkupdate && getcrt
fi fi
#提示导入订阅或者配置文件 #提示导入订阅或者配置文件
echo ----------------------------------------------- echo -----------------------------------------------

View File

@@ -185,6 +185,14 @@ EOF`
echo ----------------------------------------------- echo -----------------------------------------------
exit 1 exit 1
fi fi
#检测是否存在高级版规则
if [ "$clashcore" = "clash" -a -n "$(cat $yamlnew | grep -E '^script:|proxy-providers|rule-providers')" ];then
echo -----------------------------------------------
logger "检测到高级版核心专属规则将改为使用premium核心启动" 33
rm -rf $bindir/clash
setconfig clashcore clashpre
echo -----------------------------------------------
fi
#使用核心内置test功能检测 #使用核心内置test功能检测
if [ -x $bindir/clash ];then if [ -x $bindir/clash ];then
$bindir/clash -t -d $bindir -f $yamlnew >/dev/null $bindir/clash -t -d $bindir -f $yamlnew >/dev/null
@@ -649,6 +657,9 @@ daemon)
getconfig getconfig
cronset '#clash保守模式守护进程' "*/1 * * * * test -z \"$(pidof clash)\" && $clashdir/start.sh restart #clash保守模式守护进程" cronset '#clash保守模式守护进程' "*/1 * * * * test -z \"$(pidof clash)\" && $clashdir/start.sh restart #clash保守模式守护进程"
;; ;;
cronset)
cronset $2 $3
;;
set_proxy) set_proxy)
getconfig getconfig
#GNOME配置 #GNOME配置