Compare commits
128 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
249bccaad0 | ||
|
|
4e6aa31f9e | ||
|
|
a2a245bbd0 | ||
|
|
1078ad156f | ||
|
|
e07fa3b14f | ||
|
|
23d04efc51 | ||
|
|
b301548c8c | ||
|
|
5138c347ee | ||
|
|
1f0b7bf585 | ||
|
|
bb137d0172 | ||
|
|
3923331908 | ||
|
|
d41e091799 | ||
|
|
56405a59a3 | ||
|
|
755f1ea7a0 | ||
|
|
71c3687cf7 | ||
|
|
27914bb5eb | ||
|
|
9ac7ada37e | ||
|
|
99d81d3677 | ||
|
|
35cd1c0943 | ||
|
|
c466124c43 | ||
|
|
7cb93ebe88 | ||
|
|
07356e8c24 | ||
|
|
e0c28cb6e3 | ||
|
|
96138f75c6 | ||
|
|
96578960b0 | ||
|
|
a23e1a5967 | ||
|
|
6390a6cdba | ||
|
|
5411e32504 | ||
|
|
316c9deaea | ||
|
|
ca11585757 | ||
|
|
0f6c6c31c6 | ||
|
|
aa3a9b21c9 | ||
|
|
c221e76db7 | ||
|
|
1cb3ef90ea | ||
|
|
9d8fb3433c | ||
|
|
37c179b57c | ||
|
|
d7fc639ddd | ||
|
|
2f9a4bc2f0 | ||
|
|
064811e22a | ||
|
|
f19861c0b1 | ||
|
|
cc52ef55ef | ||
|
|
da538c366e | ||
|
|
9b429c3fb0 | ||
|
|
497bdfed3c | ||
|
|
1e3ae67b2c | ||
|
|
5c15cc4404 | ||
|
|
b2255bd788 | ||
|
|
bda8c32adc | ||
|
|
98388d4374 | ||
|
|
53ad194475 | ||
|
|
f718be6451 | ||
|
|
5b89062f35 | ||
|
|
c811031108 | ||
|
|
a44e53aad7 | ||
|
|
065ff2732d | ||
|
|
f19b9c5ba0 | ||
|
|
e4d3d51ade | ||
|
|
6deb65ad76 | ||
|
|
a629cf1001 | ||
|
|
c2cf43e025 | ||
|
|
a24aa1e49d | ||
|
|
5b0d2aeb45 | ||
|
|
cdbeb2cf7d | ||
|
|
b15a13e6a5 | ||
|
|
2a599466e9 | ||
|
|
0a771c4850 | ||
|
|
2a21e1a941 | ||
|
|
5053c9d259 | ||
|
|
9e5d33f3b4 | ||
|
|
24091320cf | ||
|
|
594a136857 | ||
|
|
58aba81a5c | ||
|
|
9467fe9ca5 | ||
|
|
50a7de95ed | ||
|
|
37a19a1472 | ||
|
|
d7fbe953ce | ||
|
|
cb847a934f | ||
|
|
14b50a3cd6 | ||
|
|
ce65617563 | ||
|
|
89c2678a42 | ||
|
|
523528b700 | ||
|
|
716ee61799 | ||
|
|
c58972ed4e | ||
|
|
aef107e27b | ||
|
|
e2aa3e2534 | ||
|
|
c2fa6d4750 | ||
|
|
9c1f4d2d5e | ||
|
|
ea434b8767 | ||
|
|
950ceb4b15 | ||
|
|
2d2afef7f3 | ||
|
|
82a13e31bd | ||
|
|
2649d6dcc6 | ||
|
|
244fcda9b9 | ||
|
|
563bc235d6 | ||
|
|
3ee6aebe62 | ||
|
|
56d1eb3a32 | ||
|
|
4dc4607ea3 | ||
|
|
c9daea0979 | ||
|
|
e434263bb6 | ||
|
|
c8aab808a0 | ||
|
|
0a7140dbf5 | ||
|
|
76a24bee7a | ||
|
|
e7237a58ba | ||
|
|
3c54dea48f | ||
|
|
7d853f5316 | ||
|
|
98620688c2 | ||
|
|
6e4b4e14a6 | ||
|
|
271865ef76 | ||
|
|
fe9784517a | ||
|
|
0f3573c304 | ||
|
|
1b784375f6 | ||
|
|
16f9b314e8 | ||
|
|
b796da40b1 | ||
|
|
089188ea82 | ||
|
|
0de3a68c60 | ||
|
|
72321edca5 | ||
|
|
deaeea0ed0 | ||
|
|
91a9ead256 | ||
|
|
f26f0fe854 | ||
|
|
24c4d9307c | ||
|
|
a1c95c2d82 | ||
|
|
9d6938fd34 | ||
|
|
5c3f529619 | ||
|
|
015b8a10b2 | ||
|
|
a09ed54d99 | ||
|
|
48ea78f7cf | ||
|
|
9295af8f89 | ||
|
|
7646c783a8 |
113
.github/workflows/bin_update.yml
vendored
Normal file
113
.github/workflows/bin_update.yml
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
name: bin_update
|
||||
|
||||
on:
|
||||
# release:
|
||||
# types: [published]
|
||||
# push:
|
||||
# tags:
|
||||
# - 'v*'
|
||||
# branches:
|
||||
# - master
|
||||
schedule:
|
||||
- cron: 0 1 * * 2
|
||||
# watch:
|
||||
# types: [started]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Apt Update
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install unzip curl git tar
|
||||
|
||||
- name: Update Dashboard
|
||||
run: |
|
||||
cd \bin
|
||||
echo 下载官方面板
|
||||
curl -kfSL -o clashdb.zip https://github.com/Dreamacro/clash-dashboard/archive/gh-pages.zip
|
||||
echo 下载Meta面板
|
||||
curl -kfSL -o meta_db.zip https://github.com/MetaCubeX/clash-dashboard/archive/gh-pages.zip
|
||||
echo 下载yacd面板
|
||||
curl -kfSL -o yacd.zip https://github.com/haishanh/yacd/archive/gh-pages.zip
|
||||
echo 下载meta魔改yacd面板
|
||||
curl -kfSL -o meta_yacd.zip https://github.com/MetaCubeX/yacd/archive/gh-pages.zip
|
||||
echo 解压缩
|
||||
unzip -o clashdb.zip > /dev/null
|
||||
unzip -o yacd.zip > /dev/null
|
||||
cd \clash-dashboard-gh-pages
|
||||
tar -zcvf clashdb.tar.gz * > /dev/null
|
||||
mv -f clashdb.tar.gz ../
|
||||
cd ..
|
||||
cd \yacd-gh-pages
|
||||
echo yacd特殊处理
|
||||
find -name '*.map' | xargs rm -rf
|
||||
rm -rf report.html
|
||||
tar -zcvf yacd.tar.gz * > /dev/null
|
||||
mv -f yacd.tar.gz ../
|
||||
cd ..
|
||||
|
||||
echo 解压缩
|
||||
unzip -o meta_db.zip > /dev/null
|
||||
unzip -o meta_yacd.zip > /dev/null
|
||||
cd \clash-dashboard-gh-pages
|
||||
tar -zcvf meta_db.tar.gz * > /dev/null
|
||||
mv -f meta_db.tar.gz ../
|
||||
cd ..
|
||||
cd \yacd-gh-pages
|
||||
echo yacd特殊处理
|
||||
find -name '*.map' | xargs rm -rf
|
||||
rm -rf report.html
|
||||
tar -zcvf meta_yacd.tar.gz * > /dev/null
|
||||
mv -f meta_yacd.tar.gz ../
|
||||
cd ..
|
||||
|
||||
rm -rf clashdb.zip
|
||||
rm -rf yacd.zip
|
||||
rm -rf meta_db.zip
|
||||
rm -rf meta_yacd.zip
|
||||
rm -rf \clash-dashboard-gh-pages
|
||||
rm -rf \yacd-gh-pages
|
||||
echo 面板更新完成!
|
||||
|
||||
- name: Update GeoIP
|
||||
run: |
|
||||
cd \bin
|
||||
source version
|
||||
curl -kfSL -O https://cdn.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/Country.mmdb
|
||||
curl -kfSL -o cn_mini.mmdb https://cdn.jsdelivr.net/gh/Hackl0us/GeoIP2-CN@release/Country.mmdb
|
||||
curl -kfSL -o china_ip_list.txt https://cdn.jsdelivr.net/gh/17mon/china_ip_list@master/china_ip_list.txt
|
||||
curl -kfSL -O https://cdn.jsdelivr.net/gh/P3TERX/ca-certificates.crt@download/ca-certificates.crt
|
||||
curl -kfSL -O https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat
|
||||
sed -i '/GeoIP_v*/'d version
|
||||
echo GeoIP_v=`date '+%Y%m%d'` >> version
|
||||
echo IP数据库及根证书文件更新完成!
|
||||
|
||||
- name: Update Core Version Info
|
||||
run: |
|
||||
chmod -R +x bin/clash*/
|
||||
sed -i "s/meta_v=.*/meta_v=$(./bin/clash.meta/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
sed -i "s/clashnet_v=.*/clashnet_v=$(./bin/clash.net/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
sed -i "s/clash_v=.*/clash_v=$(./bin/clash/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
sed -i "s/clashpre_v=.*/clashpre_v=$(./bin/clashpre/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot"
|
||||
git add . && git commit -m "自动更新最新Dashboard、地址库、根证书以及内核版本信息" || exit 0
|
||||
git push
|
||||
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 3
|
||||
58
README.md
58
README.md
@@ -17,7 +17,7 @@
|
||||
|
||||
## Function introduction:
|
||||
|
||||
~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>
|
||||
~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 online update<br>
|
||||
|
||||
## Equipment support:
|
||||
|
||||
@@ -28,7 +28,7 @@ How to use:
|
||||
|
||||
~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>
|
||||
|
||||
```sh
|
||||
```Shell
|
||||
opkg update && opkg install curl
|
||||
```
|
||||
|
||||
@@ -37,38 +37,33 @@ opkg update && opkg install curl
|
||||
##### ~Use curl:<br>
|
||||
|
||||
```Shell
|
||||
#by github-CDN
|
||||
#by fastgit.org
|
||||
export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#by GitHub
|
||||
export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#by jsdelivrCDN
|
||||
export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#by myserver
|
||||
export url='http://shellclash.ga/' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#by jsDelivr-CDN
|
||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
##### ~Use wget:<br>
|
||||
|
||||
```sh
|
||||
#By jsdelivrCDN
|
||||
export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```Shell
|
||||
#by GitHub
|
||||
export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
#By jsDelivrCDN
|
||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
~**Use a low version of wget (prompt not to support https) local installation**:<br> First clone the project to the local under the window (or [click to download the project source code zip package](https://github.com/juewuy/ShellClash/archive/refs/heads/master.zip) to the local and decompress it)
|
||||
~**Use a low version of wget (prompt not to support https) local installation**:<br>
|
||||
|
||||
```sh
|
||||
sh git clone https://github.com/juewuy/ShellClash.git
|
||||
```Shell
|
||||
#by shellclash.ga
|
||||
export url='http://shellclash.ga/' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
Then open /project address/ShellClash/bin/hfs/hfs.exe Click menu-add directory from disk-{find the directory where ShellClash source code is located}-add as real directory Click on the menu-IP address-{choose the actual IP address of your LAN} Click ShellClash-click to copy to clipboard Then use the following command to install in SSH
|
||||
|
||||
```sh
|
||||
sh export url='Paste the copied address here' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
Later, when updating the version, you need to update the local version library and open the hfs service, and then update in the SSH menu, and then you can build a local server through hfs to realize the function of uploading and updating the yaml configuration file
|
||||
|
||||
~**After installation by non-root users**, please execute the following additional commands to read environment variables:<br>
|
||||
|
||||
```shell
|
||||
```Shell
|
||||
source ~/.bashrc &> /dev/null
|
||||
```
|
||||
|
||||
@@ -81,13 +76,15 @@ clash -u #uninstall
|
||||
clash -t #test mode
|
||||
```
|
||||
|
||||
~**Install in Docker:**<br>
|
||||
|
||||
Use: https://github.com/echvoyager/shellclash_docker
|
||||
|
||||
~**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.
|
||||
```
|
||||
> 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
|
||||
```Text
|
||||
bash/ash necessary Cannot install and run scripts when all are missing
|
||||
curl/wget necessary When all are missing, it cannot be installed and updated online
|
||||
iptables important Only use pure mode when missing
|
||||
@@ -107,7 +104,7 @@ ubus/iproute-doc minimal The host address of the machine cannot be obtained nor
|
||||
|
||||
## Exchange feedback:
|
||||
|
||||
### [TG Discussion Group](https://t.me/clashfm)
|
||||
### [TG Discussion Group](https://t.me/ShellClash)
|
||||
|
||||
## Related Q&A:
|
||||
|
||||
@@ -119,7 +116,8 @@ ubus/iproute-doc minimal The host address of the machine cannot be obtained nor
|
||||
|
||||
##### <img src="http://juewuy.github.io/post-images/1604390977172.png" style="zoom:50%;" /><img src="http://juewuy.github.io/post-images/1604391042406.png" style="zoom:50%;" />
|
||||
|
||||
## Friendly promotion:
|
||||
|
||||
### [Top 8K Airport-Dler](https://dler.best/auth/register?affid=89698)
|
||||
机场推荐:
|
||||
--
|
||||
#### [Catnet](https://dash.catnet.uk/#/register?code=KOhfH9qD)<br>
|
||||
#### [Dler](https://dler.best/auth/register?affid=89698)<br>
|
||||
|
||||
|
||||
45
README_CN.md
45
README_CN.md
@@ -38,40 +38,48 @@
|
||||
~使用SSH连接工具(如putty,JuiceSSH,系统自带终端等)路由器或Linux设备的SSH管理界面或终端界面,并切换到root用户<br>
|
||||
~确认设备已经安装curl或者wget下载工具。**如未安装**,LInux设备请[参考此处](https://www.howtoing.com/install-curl-in-linux)安装curl,基于OpenWrt(小米官方系统、潘多拉、高恪等)的设备请使用如下命令安装curl:<br>
|
||||
|
||||
```shell
|
||||
```Shell
|
||||
opkg update && opkg install curl #如已安装请忽略
|
||||
```
|
||||
|
||||
~之后在SSH界面执行如下安装命令,并按照后续提示完成安装<br>
|
||||
|
||||
(**如无法连接或出现SSL连接错误,请尝试更换各种不同的安装源!**)<br>
|
||||
|
||||
~**使用curl安装**:<br>
|
||||
|
||||
```Shell
|
||||
#github-CDN源
|
||||
#fastgit.org加速
|
||||
export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#GitHub源
|
||||
export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#jsdelivrCDN源
|
||||
export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#作者私人http源
|
||||
export url='http://shellclash.ga/' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#jsDelivrCDN源
|
||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
#作者私人源
|
||||
export url='https://shellclash.ga' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
~**使用wget安装**:<br>
|
||||
|
||||
```sh
|
||||
#jsdelivrCDN源
|
||||
export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```Shell
|
||||
#GitHub源
|
||||
export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
#jsDelivrCDN源
|
||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
#作者私人源
|
||||
export url='http://shellclash.ga/' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
~**使用低版本wget(提示不支持https)安装**:<br>
|
||||
|
||||
```sh
|
||||
```Shell
|
||||
#作者私人http源
|
||||
export url='http://shellclash.ga/' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
~**非root用户安装后**请额外执行以下命令以读取环境变量:<br>
|
||||
|
||||
```shell
|
||||
```Shell
|
||||
source ~/.bashrc &> /dev/null
|
||||
```
|
||||
|
||||
@@ -84,11 +92,15 @@ clash -u #卸载脚本
|
||||
clash -t #测试模式运行
|
||||
```
|
||||
|
||||
~**DOCKER环境下安装:**<br>
|
||||
|
||||
请参考https://github.com/echvoyager/shellclash_docker
|
||||
|
||||
~**运行时的额外依赖**:<br>
|
||||
|
||||
`大部分的设备/系统都已经预装了以下的大部分依赖,使用时如无影响可以无视之`
|
||||
> 大部分的设备/系统都已经预装了以下的大部分依赖,使用时如无影响可以无视之
|
||||
|
||||
```sh
|
||||
```Text
|
||||
bash/ash 必须 全部缺少时无法安装及运行脚本
|
||||
curl/wget 必须 全部缺少时无法在线安装及更新,无法使用节点保存功能
|
||||
iptables 重要 缺少时只能使用纯净模式
|
||||
@@ -109,7 +121,7 @@ ubus/iproute-doc 极低 缺少时无法正常获取本机host地址
|
||||
|
||||
交流反馈:
|
||||
--
|
||||
### [TG讨论组](https://t.me/clashfm)
|
||||
### [TG讨论组](https://t.me/ShellClash)
|
||||
|
||||
相关Q&A:
|
||||
--
|
||||
@@ -122,6 +134,7 @@ ubus/iproute-doc 极低 缺少时无法正常获取本机host地址
|
||||
|
||||
##### <img src="http://juewuy.github.io/post-images/1604390977172.png" style="zoom:50%;" /><img src="http://juewuy.github.io/post-images/1604391042406.png" style="zoom:50%;" />
|
||||
|
||||
友情推广:
|
||||
机场推荐:
|
||||
--
|
||||
### [顶级8K专线机场-墙洞](https://dler.best/auth/register?affid=89698)
|
||||
#### [梦迪-高速专线,流媒体解锁,月付推荐](https://dash.catnet.uk/#/register?code=KOhfH9qD)<br>
|
||||
#### [墙洞-老牌稳定,流媒体解锁,年付推荐](https://dler.best/auth/register?affid=89698)<br>
|
||||
|
||||
BIN
bin/Country.mmdb
BIN
bin/Country.mmdb
Binary file not shown.
@@ -5,7 +5,9 @@
|
||||
1.1.0.0/24
|
||||
1.1.2.0/23
|
||||
1.1.4.0/22
|
||||
1.1.8.0/21
|
||||
1.1.9.0/24
|
||||
1.1.10.0/23
|
||||
1.1.12.0/22
|
||||
1.1.16.0/20
|
||||
1.1.32.0/19
|
||||
1.2.0.0/23
|
||||
@@ -93,16 +95,13 @@
|
||||
15.230.41.0/24
|
||||
15.230.49.0/24
|
||||
15.230.141.0/24
|
||||
17.127.128.0/23
|
||||
20.139.160.0/20
|
||||
20.249.255.0/24
|
||||
20.251.0.0/22
|
||||
20.253.4.0/24
|
||||
20.253.89.0/24
|
||||
20.255.255.0/24
|
||||
27.0.128.0/22
|
||||
27.0.132.0/24
|
||||
27.0.134.0/23
|
||||
27.0.128.0/21
|
||||
27.0.160.0/21
|
||||
27.0.188.0/22
|
||||
27.0.204.0/22
|
||||
@@ -237,7 +236,6 @@
|
||||
42.83.88.0/21
|
||||
42.83.96.0/19
|
||||
42.83.128.0/23
|
||||
42.83.134.0/24
|
||||
42.83.138.0/23
|
||||
42.83.140.0/22
|
||||
42.83.144.0/20
|
||||
@@ -314,47 +312,43 @@
|
||||
42.247.64.0/18
|
||||
42.247.128.0/17
|
||||
42.248.0.0/13
|
||||
43.0.0.0/10
|
||||
43.64.0.0/12
|
||||
43.80.0.0/13
|
||||
43.88.128.0/17
|
||||
43.89.0.0/16
|
||||
43.90.0.0/15
|
||||
43.95.64.0/19
|
||||
43.95.96.0/20
|
||||
43.95.112.0/21
|
||||
43.96.0.0/11
|
||||
43.130.128.0/18
|
||||
43.131.128.0/18
|
||||
43.0.0.0/9
|
||||
43.131.160.0/19
|
||||
43.132.8.0/24
|
||||
43.132.10.0/23
|
||||
43.132.12.0/22
|
||||
43.132.16.0/20
|
||||
43.132.32.0/19
|
||||
43.132.36.0/22
|
||||
43.132.48.0/22
|
||||
43.132.56.0/21
|
||||
43.132.75.0/24
|
||||
43.132.78.0/23
|
||||
43.132.87.0/24
|
||||
43.132.92.0/24
|
||||
43.135.224.0/19
|
||||
43.136.0.0/13
|
||||
43.144.0.0/13
|
||||
43.152.4.0/22
|
||||
43.152.8.0/23
|
||||
43.152.11.0/24
|
||||
43.152.12.0/22
|
||||
43.152.16.0/20
|
||||
43.152.32.0/20
|
||||
43.152.7.0/24
|
||||
43.152.9.0/24
|
||||
43.152.12.0/24
|
||||
43.152.16.0/22
|
||||
43.152.20.0/23
|
||||
43.152.28.0/22
|
||||
43.152.32.0/22
|
||||
43.152.38.0/23
|
||||
43.152.40.0/22
|
||||
43.152.46.0/23
|
||||
43.152.48.0/22
|
||||
43.152.52.0/23
|
||||
43.152.52.0/24
|
||||
43.152.55.0/24
|
||||
43.152.57.0/24
|
||||
43.152.60.0/22
|
||||
43.152.64.0/18
|
||||
43.152.128.0/17
|
||||
43.153.64.0/18
|
||||
43.156.0.0/16
|
||||
43.157.192.0/18
|
||||
43.158.0.0/15
|
||||
43.152.61.0/24
|
||||
43.152.63.0/24
|
||||
43.152.65.0/24
|
||||
43.152.76.0/22
|
||||
43.152.96.0/19
|
||||
43.152.128.0/18
|
||||
43.159.16.0/20
|
||||
43.159.32.0/19
|
||||
43.159.64.0/18
|
||||
43.159.128.0/17
|
||||
43.160.0.0/11
|
||||
43.192.0.0/14
|
||||
43.196.0.0/15
|
||||
@@ -443,15 +437,7 @@
|
||||
43.231.144.0/20
|
||||
43.231.160.0/20
|
||||
43.231.176.0/21
|
||||
43.236.0.0/16
|
||||
43.237.0.0/17
|
||||
43.237.128.0/18
|
||||
43.237.192.0/22
|
||||
43.237.197.0/24
|
||||
43.237.198.0/23
|
||||
43.237.200.0/21
|
||||
43.237.208.0/20
|
||||
43.237.224.0/19
|
||||
43.236.0.0/15
|
||||
43.238.0.0/16
|
||||
43.239.0.0/19
|
||||
43.239.32.0/20
|
||||
@@ -518,8 +504,6 @@
|
||||
43.246.64.0/19
|
||||
43.246.96.0/22
|
||||
43.246.112.0/24
|
||||
43.246.148.0/24
|
||||
43.246.150.0/24
|
||||
43.246.228.0/22
|
||||
43.247.4.0/22
|
||||
43.247.8.0/22
|
||||
@@ -636,8 +620,6 @@
|
||||
45.40.208.0/21
|
||||
45.40.224.0/19
|
||||
45.65.16.0/20
|
||||
45.87.53.0/24
|
||||
45.87.54.0/24
|
||||
45.112.132.0/22
|
||||
45.112.188.0/22
|
||||
45.112.208.0/20
|
||||
@@ -932,6 +914,8 @@
|
||||
59.108.0.0/14
|
||||
59.151.0.0/17
|
||||
59.152.16.0/20
|
||||
59.152.32.0/23
|
||||
59.152.34.0/24
|
||||
59.152.36.0/22
|
||||
59.152.64.0/20
|
||||
59.152.112.0/21
|
||||
@@ -942,7 +926,6 @@
|
||||
59.153.92.0/22
|
||||
59.153.136.0/22
|
||||
59.153.152.0/22
|
||||
59.153.159.0/24
|
||||
59.153.164.0/22
|
||||
59.153.168.0/21
|
||||
59.153.176.0/20
|
||||
@@ -990,11 +973,7 @@
|
||||
61.232.0.0/14
|
||||
61.236.0.0/15
|
||||
61.240.0.0/14
|
||||
62.3.6.0/24
|
||||
62.234.0.0/16
|
||||
64.188.38.0/23
|
||||
64.188.40.0/22
|
||||
64.188.44.0/23
|
||||
68.79.0.0/18
|
||||
69.230.192.0/18
|
||||
69.231.128.0/18
|
||||
@@ -1141,6 +1120,7 @@
|
||||
103.4.56.0/22
|
||||
103.4.168.0/22
|
||||
103.4.184.0/22
|
||||
103.4.224.0/22
|
||||
103.5.36.0/22
|
||||
103.5.52.0/24
|
||||
103.5.56.0/22
|
||||
@@ -1162,7 +1142,8 @@
|
||||
103.8.68.0/22
|
||||
103.8.108.0/22
|
||||
103.8.156.0/22
|
||||
103.8.200.0/21
|
||||
103.8.200.0/23
|
||||
103.8.204.0/22
|
||||
103.8.220.0/22
|
||||
103.9.8.0/22
|
||||
103.9.24.0/22
|
||||
@@ -1521,7 +1502,6 @@
|
||||
103.59.76.0/22
|
||||
103.59.112.0/21
|
||||
103.59.120.0/24
|
||||
103.59.123.0/24
|
||||
103.59.124.0/22
|
||||
103.59.128.0/22
|
||||
103.59.148.0/22
|
||||
@@ -1656,8 +1636,7 @@
|
||||
103.75.112.0/22
|
||||
103.75.120.0/22
|
||||
103.75.128.0/22
|
||||
103.75.144.0/23
|
||||
103.75.146.0/24
|
||||
103.75.144.0/22
|
||||
103.75.152.0/22
|
||||
103.76.60.0/22
|
||||
103.76.64.0/21
|
||||
@@ -1717,7 +1696,6 @@
|
||||
103.83.72.0/22
|
||||
103.83.112.0/22
|
||||
103.83.132.0/22
|
||||
103.83.180.0/22
|
||||
103.84.0.0/22
|
||||
103.84.12.0/22
|
||||
103.84.20.0/22
|
||||
@@ -1859,9 +1837,9 @@
|
||||
103.98.224.0/21
|
||||
103.98.232.0/22
|
||||
103.98.240.0/21
|
||||
103.98.248.0/23
|
||||
103.98.250.0/24
|
||||
103.98.252.0/22
|
||||
103.99.55.0/24
|
||||
103.99.56.0/22
|
||||
103.99.104.0/22
|
||||
103.99.116.0/22
|
||||
@@ -2004,6 +1982,7 @@
|
||||
103.117.188.0/22
|
||||
103.117.220.0/22
|
||||
103.118.19.0/24
|
||||
103.118.36.0/22
|
||||
103.118.52.0/22
|
||||
103.118.56.0/21
|
||||
103.118.64.0/21
|
||||
@@ -2056,7 +2035,6 @@
|
||||
103.126.44.0/22
|
||||
103.126.124.0/22
|
||||
103.126.128.0/22
|
||||
103.129.53.0/24
|
||||
103.129.54.0/23
|
||||
103.129.148.0/22
|
||||
103.130.132.0/22
|
||||
@@ -2148,7 +2126,6 @@
|
||||
103.145.94.0/23
|
||||
103.145.98.0/23
|
||||
103.145.188.0/23
|
||||
103.146.6.0/23
|
||||
103.146.72.0/23
|
||||
103.146.126.0/23
|
||||
103.146.138.0/23
|
||||
@@ -2208,7 +2185,6 @@
|
||||
103.154.164.0/23
|
||||
103.154.168.0/23
|
||||
103.155.14.0/23
|
||||
103.155.17.0/24
|
||||
103.155.34.0/23
|
||||
103.155.48.0/23
|
||||
103.155.76.0/23
|
||||
@@ -2233,7 +2209,6 @@
|
||||
103.158.16.0/23
|
||||
103.158.200.0/23
|
||||
103.158.224.0/23
|
||||
103.159.80.0/23
|
||||
103.159.122.0/23
|
||||
103.159.124.0/23
|
||||
103.159.134.0/23
|
||||
@@ -2281,7 +2256,6 @@
|
||||
103.169.108.0/23
|
||||
103.169.162.0/23
|
||||
103.169.202.0/23
|
||||
103.169.216.0/23
|
||||
103.170.4.0/23
|
||||
103.170.134.0/23
|
||||
103.170.212.0/23
|
||||
@@ -2294,7 +2268,6 @@
|
||||
103.173.182.0/23
|
||||
103.173.184.0/23
|
||||
103.174.94.0/23
|
||||
103.175.14.0/23
|
||||
103.175.114.0/23
|
||||
103.175.118.0/23
|
||||
103.176.52.0/23
|
||||
@@ -2302,6 +2275,17 @@
|
||||
103.176.244.0/23
|
||||
103.177.28.0/23
|
||||
103.177.70.0/23
|
||||
103.178.56.0/23
|
||||
103.178.240.0/23
|
||||
103.179.76.0/22
|
||||
103.180.108.0/23
|
||||
103.180.226.0/23
|
||||
103.181.164.0/23
|
||||
103.181.234.0/23
|
||||
103.183.26.0/23
|
||||
103.183.66.0/23
|
||||
103.183.122.0/23
|
||||
103.183.124.0/23
|
||||
103.192.0.0/19
|
||||
103.192.48.0/21
|
||||
103.192.56.0/22
|
||||
@@ -2558,7 +2542,9 @@
|
||||
103.223.96.0/20
|
||||
103.223.112.0/21
|
||||
103.223.124.0/22
|
||||
103.223.128.0/21
|
||||
103.223.128.0/22
|
||||
103.223.133.0/24
|
||||
103.223.134.0/23
|
||||
103.223.140.0/22
|
||||
103.223.144.0/20
|
||||
103.223.160.0/20
|
||||
@@ -2644,7 +2630,8 @@
|
||||
103.235.80.0/22
|
||||
103.235.85.0/24
|
||||
103.235.87.0/24
|
||||
103.235.128.0/20
|
||||
103.235.132.0/22
|
||||
103.235.136.0/21
|
||||
103.235.144.0/21
|
||||
103.235.184.0/22
|
||||
103.235.192.0/22
|
||||
@@ -2656,7 +2643,10 @@
|
||||
103.236.96.0/22
|
||||
103.236.120.0/22
|
||||
103.236.184.0/22
|
||||
103.236.240.0/20
|
||||
103.236.240.0/21
|
||||
103.236.248.0/23
|
||||
103.236.250.0/24
|
||||
103.236.252.0/22
|
||||
103.237.0.0/20
|
||||
103.237.24.0/21
|
||||
103.237.68.0/22
|
||||
@@ -2816,13 +2806,7 @@
|
||||
106.0.16.0/20
|
||||
106.0.44.0/22
|
||||
106.0.64.0/18
|
||||
106.2.0.0/17
|
||||
106.2.128.0/20
|
||||
106.2.144.0/21
|
||||
106.2.152.0/22
|
||||
106.2.156.0/23
|
||||
106.2.160.0/19
|
||||
106.2.192.0/18
|
||||
106.2.0.0/16
|
||||
106.3.16.0/20
|
||||
106.3.32.0/19
|
||||
106.3.64.0/20
|
||||
@@ -2961,8 +2945,7 @@
|
||||
111.223.8.0/21
|
||||
111.223.16.0/22
|
||||
111.223.240.0/22
|
||||
111.223.249.0/24
|
||||
111.223.250.0/23
|
||||
111.223.248.0/22
|
||||
111.224.0.0/13
|
||||
111.235.96.0/19
|
||||
111.235.156.0/22
|
||||
@@ -3046,8 +3029,11 @@
|
||||
114.60.0.0/14
|
||||
114.64.0.0/15
|
||||
114.66.0.0/17
|
||||
114.66.160.0/19
|
||||
114.66.192.0/18
|
||||
114.66.192.0/20
|
||||
114.66.208.0/21
|
||||
114.66.216.0/22
|
||||
114.66.236.0/22
|
||||
114.66.240.0/20
|
||||
114.67.0.0/16
|
||||
114.68.0.0/18
|
||||
114.68.64.0/19
|
||||
@@ -3121,12 +3107,13 @@
|
||||
115.152.0.0/13
|
||||
115.166.64.0/19
|
||||
115.168.0.0/16
|
||||
115.169.0.0/23
|
||||
115.169.3.0/24
|
||||
115.169.6.0/24
|
||||
115.169.9.0/24
|
||||
115.169.0.0/22
|
||||
115.169.6.0/23
|
||||
115.169.8.0/23
|
||||
115.169.10.0/24
|
||||
115.169.14.0/23
|
||||
115.169.16.0/20
|
||||
115.169.32.0/22
|
||||
115.169.39.0/24
|
||||
115.169.40.0/24
|
||||
115.169.42.0/23
|
||||
@@ -3288,8 +3275,10 @@
|
||||
118.26.121.0/24
|
||||
118.26.122.0/23
|
||||
118.26.124.0/23
|
||||
118.26.128.0/20
|
||||
118.26.144.0/22
|
||||
118.26.128.0/22
|
||||
118.26.133.0/24
|
||||
118.26.134.0/23
|
||||
118.26.136.0/21
|
||||
118.26.149.0/24
|
||||
118.26.150.0/23
|
||||
118.26.156.0/22
|
||||
@@ -3553,7 +3542,9 @@
|
||||
121.58.144.0/20
|
||||
121.58.160.0/21
|
||||
121.59.0.0/20
|
||||
121.59.16.0/21
|
||||
121.59.16.0/24
|
||||
121.59.18.0/23
|
||||
121.59.20.0/22
|
||||
121.59.24.0/22
|
||||
121.59.28.0/24
|
||||
121.59.31.0/24
|
||||
@@ -3566,12 +3557,16 @@
|
||||
121.59.101.0/24
|
||||
121.59.102.0/23
|
||||
121.59.104.0/23
|
||||
121.59.108.0/22
|
||||
121.59.108.0/24
|
||||
121.59.110.0/23
|
||||
121.59.112.0/21
|
||||
121.59.121.0/24
|
||||
121.59.122.0/23
|
||||
121.59.124.0/22
|
||||
121.59.128.0/21
|
||||
121.59.123.0/24
|
||||
121.59.125.0/24
|
||||
121.59.126.0/23
|
||||
121.59.129.0/24
|
||||
121.59.130.0/23
|
||||
121.59.132.0/22
|
||||
121.59.136.0/22
|
||||
121.59.141.0/24
|
||||
121.59.142.0/23
|
||||
@@ -3610,7 +3605,7 @@
|
||||
122.8.88.0/24
|
||||
122.8.91.0/24
|
||||
122.8.92.0/22
|
||||
122.8.128.0/17
|
||||
122.8.192.0/18
|
||||
122.9.0.0/16
|
||||
122.10.132.0/23
|
||||
122.10.136.0/23
|
||||
@@ -3769,12 +3764,12 @@
|
||||
124.68.192.0/19
|
||||
124.68.224.0/23
|
||||
124.68.226.0/24
|
||||
124.68.228.0/22
|
||||
124.68.228.0/24
|
||||
124.68.230.0/23
|
||||
124.68.232.0/21
|
||||
124.68.240.0/23
|
||||
124.68.242.0/24
|
||||
124.68.244.0/23
|
||||
124.68.254.0/24
|
||||
124.69.0.0/16
|
||||
124.70.0.0/16
|
||||
124.71.0.0/17
|
||||
@@ -3843,7 +3838,6 @@
|
||||
129.28.0.0/16
|
||||
129.204.0.0/16
|
||||
129.211.0.0/16
|
||||
129.223.254.0/24
|
||||
130.36.146.0/23
|
||||
130.214.218.0/23
|
||||
131.228.96.0/24
|
||||
@@ -3853,7 +3847,6 @@
|
||||
132.232.0.0/16
|
||||
132.237.134.0/24
|
||||
134.175.0.0/16
|
||||
135.84.255.0/24
|
||||
135.159.208.0/20
|
||||
135.244.80.0/20
|
||||
137.59.59.0/24
|
||||
@@ -3911,7 +3904,10 @@
|
||||
139.198.116.0/22
|
||||
139.198.122.0/23
|
||||
139.198.124.0/22
|
||||
139.198.128.0/17
|
||||
139.198.128.0/18
|
||||
139.198.192.0/21
|
||||
139.198.208.0/20
|
||||
139.198.224.0/19
|
||||
139.199.0.0/16
|
||||
139.200.0.0/13
|
||||
139.208.0.0/13
|
||||
@@ -3948,6 +3944,7 @@
|
||||
140.255.0.0/16
|
||||
142.70.0.0/16
|
||||
142.86.0.0/16
|
||||
143.64.0.0/16
|
||||
144.0.0.0/16
|
||||
144.7.0.0/16
|
||||
144.12.0.0/16
|
||||
@@ -3974,11 +3971,10 @@
|
||||
146.222.79.0/24
|
||||
146.222.81.0/24
|
||||
146.222.94.0/24
|
||||
147.243.13.32/27
|
||||
147.243.13.64/27
|
||||
147.243.14.32/27
|
||||
147.243.103.0/25
|
||||
148.70.0.0/16
|
||||
148.163.174.0/24
|
||||
150.0.0.0/16
|
||||
150.115.0.0/16
|
||||
150.121.0.0/16
|
||||
@@ -4080,7 +4076,6 @@
|
||||
160.202.216.0/21
|
||||
160.202.224.0/19
|
||||
160.238.64.0/22
|
||||
161.49.5.7/32
|
||||
161.120.0.0/16
|
||||
161.163.0.0/21
|
||||
161.163.28.0/23
|
||||
@@ -4118,9 +4113,8 @@
|
||||
163.228.0.0/16
|
||||
163.244.246.0/24
|
||||
164.52.80.0/24
|
||||
165.154.100.0/22
|
||||
165.154.104.0/21
|
||||
165.154.112.0/20
|
||||
165.154.122.0/23
|
||||
165.154.124.0/22
|
||||
165.154.128.0/18
|
||||
165.154.192.0/19
|
||||
165.156.30.0/24
|
||||
@@ -4173,6 +4167,7 @@
|
||||
175.185.0.0/16
|
||||
175.186.0.0/15
|
||||
175.188.0.0/14
|
||||
178.171.110.0/23
|
||||
180.76.16.0/20
|
||||
180.76.32.0/19
|
||||
180.76.64.0/18
|
||||
@@ -4320,6 +4315,8 @@
|
||||
198.175.100.0/22
|
||||
198.208.17.0/24
|
||||
198.208.19.0/24
|
||||
198.208.30.0/24
|
||||
198.208.61.0/24
|
||||
199.7.72.0/24
|
||||
199.65.192.0/21
|
||||
199.244.144.0/24
|
||||
@@ -4705,17 +4702,6 @@
|
||||
202.158.242.0/24
|
||||
202.160.140.0/22
|
||||
202.160.156.0/22
|
||||
202.160.176.64/29
|
||||
202.160.176.72/30
|
||||
202.160.176.76/32
|
||||
202.160.176.78/31
|
||||
202.160.176.80/28
|
||||
202.160.176.96/27
|
||||
202.160.176.128/25
|
||||
202.160.177.0/24
|
||||
202.160.178.0/23
|
||||
202.160.180.0/22
|
||||
202.160.184.0/21
|
||||
202.162.67.0/24
|
||||
202.162.75.0/24
|
||||
202.164.0.0/20
|
||||
@@ -5580,7 +5566,13 @@
|
||||
203.83.12.0/22
|
||||
203.83.56.0/21
|
||||
203.83.224.0/20
|
||||
203.86.0.0/17
|
||||
203.86.0.0/18
|
||||
203.86.64.0/19
|
||||
203.86.96.0/22
|
||||
203.86.100.0/24
|
||||
203.86.102.0/23
|
||||
203.86.104.0/21
|
||||
203.86.112.0/20
|
||||
203.86.250.0/24
|
||||
203.86.254.0/23
|
||||
203.88.32.0/19
|
||||
@@ -5752,7 +5744,6 @@
|
||||
210.2.8.0/21
|
||||
210.2.24.0/21
|
||||
210.5.0.0/19
|
||||
210.5.60.0/24
|
||||
210.5.128.0/19
|
||||
210.7.56.0/21
|
||||
210.12.0.0/15
|
||||
@@ -5875,12 +5866,7 @@
|
||||
218.98.77.0/24
|
||||
218.98.78.0/23
|
||||
218.98.80.0/24
|
||||
218.98.92.0/22
|
||||
218.98.96.0/22
|
||||
218.98.100.0/24
|
||||
218.98.102.0/23
|
||||
218.98.104.0/21
|
||||
218.98.112.0/20
|
||||
218.98.96.0/19
|
||||
218.98.128.0/19
|
||||
218.98.192.0/18
|
||||
218.99.0.0/16
|
||||
@@ -5897,7 +5883,8 @@
|
||||
218.246.48.0/21
|
||||
218.246.56.0/23
|
||||
218.246.58.0/24
|
||||
218.246.60.0/22
|
||||
218.246.61.0/24
|
||||
218.246.62.0/23
|
||||
218.246.64.0/18
|
||||
218.246.129.0/24
|
||||
218.246.131.0/24
|
||||
@@ -6070,7 +6057,12 @@
|
||||
222.126.180.0/22
|
||||
222.126.184.0/21
|
||||
222.126.192.0/21
|
||||
222.126.200.16/29
|
||||
222.126.200.100/30
|
||||
222.126.200.104/29
|
||||
222.126.200.128/29
|
||||
222.126.200.184/30
|
||||
222.126.200.200/29
|
||||
222.126.206.0/23
|
||||
222.126.208.0/22
|
||||
222.126.212.0/26
|
||||
@@ -6097,7 +6089,16 @@
|
||||
223.96.0.0/12
|
||||
223.112.0.0/14
|
||||
223.116.0.0/15
|
||||
223.120.0.0/13
|
||||
223.122.1.0/24
|
||||
223.122.2.0/23
|
||||
223.122.4.0/22
|
||||
223.122.8.0/21
|
||||
223.122.16.0/20
|
||||
223.122.32.0/19
|
||||
223.122.64.0/18
|
||||
223.122.128.0/17
|
||||
223.123.0.0/16
|
||||
223.124.0.0/14
|
||||
223.128.0.0/15
|
||||
223.144.0.0/12
|
||||
223.160.0.0/14
|
||||
|
||||
BIN
bin/clash.meta/clash-linux-amd64
Normal file → Executable file
BIN
bin/clash.meta/clash-linux-amd64
Normal file → Executable file
Binary file not shown.
BIN
bin/clash.meta/clash-linux-armv5
Normal file → Executable file
BIN
bin/clash.meta/clash-linux-armv5
Normal file → Executable file
Binary file not shown.
BIN
bin/clash.meta/clash-linux-armv7
Normal file → Executable file
BIN
bin/clash.meta/clash-linux-armv7
Normal file → Executable file
Binary file not shown.
BIN
bin/clash.meta/clash-linux-armv8
Normal file → Executable file
BIN
bin/clash.meta/clash-linux-armv8
Normal file → Executable file
Binary file not shown.
BIN
bin/clash.meta/clash-linux-mips-softfloat
Normal file → Executable file
BIN
bin/clash.meta/clash-linux-mips-softfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/clash.meta/clash-linux-mipsle-hardfloat
Normal file → Executable file
BIN
bin/clash.meta/clash-linux-mipsle-hardfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/clash.meta/clash-linux-mipsle-softfloat
Normal file → Executable file
BIN
bin/clash.meta/clash-linux-mipsle-softfloat
Normal file → Executable file
Binary file not shown.
0
bin/clash.net/clash-linux-386
Normal file → Executable file
0
bin/clash.net/clash-linux-386
Normal file → Executable file
0
bin/clash.net/clash-linux-amd64
Normal file → Executable file
0
bin/clash.net/clash-linux-amd64
Normal file → Executable file
0
bin/clash.net/clash-linux-armv5
Normal file → Executable file
0
bin/clash.net/clash-linux-armv5
Normal file → Executable file
0
bin/clash.net/clash-linux-armv7
Normal file → Executable file
0
bin/clash.net/clash-linux-armv7
Normal file → Executable file
0
bin/clash.net/clash-linux-armv8
Normal file → Executable file
0
bin/clash.net/clash-linux-armv8
Normal file → Executable file
0
bin/clash.net/clash-linux-mips-softfloat
Normal file → Executable file
0
bin/clash.net/clash-linux-mips-softfloat
Normal file → Executable file
0
bin/clash.net/clash-linux-mipsle-hardfloat
Normal file → Executable file
0
bin/clash.net/clash-linux-mipsle-hardfloat
Normal file → Executable file
0
bin/clash.net/clash-linux-mipsle-softfloat
Normal file → Executable file
0
bin/clash.net/clash-linux-mipsle-softfloat
Normal file → Executable file
BIN
bin/clash/clash-linux-386
Normal file → Executable file
BIN
bin/clash/clash-linux-386
Normal file → Executable file
Binary file not shown.
BIN
bin/clash/clash-linux-amd64
Normal file → Executable file
BIN
bin/clash/clash-linux-amd64
Normal file → Executable file
Binary file not shown.
BIN
bin/clash/clash-linux-armv5
Normal file → Executable file
BIN
bin/clash/clash-linux-armv5
Normal file → Executable file
Binary file not shown.
BIN
bin/clash/clash-linux-armv7
Normal file → Executable file
BIN
bin/clash/clash-linux-armv7
Normal file → Executable file
Binary file not shown.
BIN
bin/clash/clash-linux-armv8
Normal file → Executable file
BIN
bin/clash/clash-linux-armv8
Normal file → Executable file
Binary file not shown.
BIN
bin/clash/clash-linux-mips-softfloat
Normal file → Executable file
BIN
bin/clash/clash-linux-mips-softfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/clash/clash-linux-mipsle-hardfloat
Normal file → Executable file
BIN
bin/clash/clash-linux-mipsle-hardfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/clash/clash-linux-mipsle-softfloat
Normal file → Executable file
BIN
bin/clash/clash-linux-mipsle-softfloat
Normal file → Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/clashpre/clash-linux-386
Normal file → Executable file
BIN
bin/clashpre/clash-linux-386
Normal file → Executable file
Binary file not shown.
BIN
bin/clashpre/clash-linux-amd64
Normal file → Executable file
BIN
bin/clashpre/clash-linux-amd64
Normal file → Executable file
Binary file not shown.
BIN
bin/clashpre/clash-linux-armv5
Normal file → Executable file
BIN
bin/clashpre/clash-linux-armv5
Normal file → Executable file
Binary file not shown.
BIN
bin/clashpre/clash-linux-armv7
Normal file → Executable file
BIN
bin/clashpre/clash-linux-armv7
Normal file → Executable file
Binary file not shown.
BIN
bin/clashpre/clash-linux-armv8
Normal file → Executable file
BIN
bin/clashpre/clash-linux-armv8
Normal file → Executable file
Binary file not shown.
BIN
bin/clashpre/clash-linux-mips-softfloat
Normal file → Executable file
BIN
bin/clashpre/clash-linux-mips-softfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/clashpre/clash-linux-mipsle-hardfloat
Normal file → Executable file
BIN
bin/clashpre/clash-linux-mipsle-hardfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/clashpre/clash-linux-mipsle-softfloat
Normal file → Executable file
BIN
bin/clashpre/clash-linux-mipsle-softfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/cn_mini.mmdb
BIN
bin/cn_mini.mmdb
Binary file not shown.
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 114 KiB |
67630
bin/geosite.dat
67630
bin/geosite.dat
File diff suppressed because one or more lines are too long
BIN
bin/meta_db.tar.gz
Normal file
BIN
bin/meta_db.tar.gz
Normal file
Binary file not shown.
BIN
bin/meta_yacd.tar.gz
Normal file
BIN
bin/meta_yacd.tar.gz
Normal file
Binary file not shown.
@@ -1,8 +1,7 @@
|
||||
1.5.0
|
||||
1.6.0
|
||||
1.5.1
|
||||
1.3.0
|
||||
1.2.0
|
||||
1.1.0
|
||||
1.0.0beta17
|
||||
1.0.0beta11
|
||||
1.0.0beta5
|
||||
0.9.7
|
||||
|
||||
12
bin/version
12
bin/version
@@ -1,6 +1,6 @@
|
||||
clashnet_v=1.7.6
|
||||
GeoIP_v=202201280303
|
||||
clashpre_v=2022.01.27
|
||||
clash_v=1.9.0
|
||||
meta_v=1.9.0dev
|
||||
versionsh=1.5.0
|
||||
clashnet_v=v1.7.6
|
||||
clashpre_v=2021.09.15
|
||||
clash_v=v1.7.1
|
||||
meta_v=v1.11.0
|
||||
GeoIP_v=20220529
|
||||
versionsh=1.6.0
|
||||
|
||||
BIN
bin/yacd.tar.gz
BIN
bin/yacd.tar.gz
Binary file not shown.
69
install.sh
69
install.sh
@@ -9,10 +9,17 @@ echo "** 欢迎使用 **"
|
||||
echo "** ShellClash **"
|
||||
echo "** by Juewuy **"
|
||||
echo "***********************************************"
|
||||
|
||||
dir_avail(){
|
||||
df -h $1 |awk '{ for(i=1;i<=NF;i++){ if(NR==1){ arr[i]=$i; }else{ arr[i]=arr[i]" "$i; } } } END{ for(i=1;i<=NF;i++){ print arr[i]; } }' |grep Ava |awk '{print $2}'
|
||||
}
|
||||
setconfig(){
|
||||
configpath=$clashdir/mark
|
||||
[ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
|
||||
}
|
||||
[ -f "/etc/storage/started_script.sh" ] && systype=Padavan && initdir='/etc/storage/started_script.sh'
|
||||
[ -d "/jffs/scripts" ] && systype=asusrouter && initdir='/jffs/scripts/net-start'
|
||||
[ -f "/jffs/.asusrouter" ] && systype=asusrouter && initdir='/jffs/.asusrouter'
|
||||
[ -f "/data/etc/crontabs/root" -a "$(dir_avail /etc)" = 0 ] && systype=mi_snapshot
|
||||
#检查root权限
|
||||
if [ "$USER" != "root" -a -z "$systype" ];then
|
||||
echo 当前用户:$USER
|
||||
@@ -21,6 +28,7 @@ if [ "$USER" != "root" -a -z "$systype" ];then
|
||||
read -p "仍要安装?可能会产生未知错误!(1/0) > " res
|
||||
[ "$res" != "1" ] && exit 1
|
||||
fi
|
||||
|
||||
webget(){
|
||||
#参数【$1】代表下载目录,【$2】代表在线地址
|
||||
#参数【$3】代表输出显示,【$4】不启用重定向
|
||||
@@ -28,7 +36,7 @@ webget(){
|
||||
[ "$3" = "echooff" ] && progress='-s' || progress='-#'
|
||||
[ -z "$4" ] && redirect='-L' || redirect=''
|
||||
result=$(curl -w %{http_code} --connect-timeout 5 $progress $redirect -ko $1 $2)
|
||||
[ -z $(echo $result | grep -e ^2) && result="200"
|
||||
[ -n "$(echo $result | grep -e ^2)" ] && result="200"
|
||||
else
|
||||
if wget --version > /dev/null 2>&1;then
|
||||
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
|
||||
@@ -43,8 +51,8 @@ webget(){
|
||||
fi
|
||||
}
|
||||
#检查更新
|
||||
[ -z "$url" ] && url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash"
|
||||
#选择版本
|
||||
url_cdn="https://raw.githubusercontents.com/juewuy/ShellClash"
|
||||
[ -z "$url" ] && url=$url_cdn
|
||||
echo -----------------------------------------------
|
||||
$echo "\033[33m请选择想要安装的版本:\033[0m"
|
||||
$echo " 1 \033[32mShellclash正式版\033[0m"
|
||||
@@ -52,24 +60,23 @@ $echo " 2 \033[31mShellclash测试版\033[0m"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入相应数字 > " num
|
||||
if [ -z $num ];then
|
||||
echo 安装已取消
|
||||
exit 1;
|
||||
echo 安装已取消! && exit 1;
|
||||
elif [ "$num" = "1" ];then
|
||||
webget /tmp/clashrelease $url/bin/release_version echoon rediroff 2>/tmp/clashrelease
|
||||
webget /tmp/clashrelease $url_cdn/master/bin/release_version echoon rediroff 2>/tmp/clashrelease
|
||||
if [ "$result" = "200" ];then
|
||||
release_new=$(cat /tmp/clashrelease | head -1)
|
||||
url2="https://cdn.jsdelivr.net/gh/juewuy/ShellClash@$release_new"
|
||||
url_dl="$url_cdn/$release_new"
|
||||
else
|
||||
echo "无法切换版本,尝试安装测试版!"
|
||||
fi
|
||||
fi
|
||||
[ -z "$url2" ] && url2=$url
|
||||
webget /tmp/clashversion "$url2/bin/version" echooff
|
||||
[ -z "$url_dl" ] && url_dl=$url
|
||||
webget /tmp/clashversion "$url_dl/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
|
||||
tarurl=$url2/bin/clashfm.tar.gz
|
||||
tarurl=$url_dl/bin/clashfm.tar.gz
|
||||
|
||||
gettar(){
|
||||
webget /tmp/clashfm.tar.gz $tarurl
|
||||
@@ -86,8 +93,8 @@ gettar(){
|
||||
#判断系统类型写入不同的启动文件
|
||||
if [ -f /etc/rc.common ];then
|
||||
#设为init.d方式启动
|
||||
mv $clashdir/clashservice /etc/init.d/clash
|
||||
chmod 777 /etc/init.d/clash
|
||||
cp -f $clashdir/clashservice /etc/init.d/clash
|
||||
chmod 755 /etc/init.d/clash
|
||||
else
|
||||
[ -w /etc/systemd/system ] && sysdir=/etc/systemd/system
|
||||
[ -w /usr/lib/systemd/system ] && sysdir=/usr/lib/systemd/system
|
||||
@@ -98,19 +105,16 @@ gettar(){
|
||||
systemctl daemon-reload
|
||||
else
|
||||
#设为保守模式启动
|
||||
sed -i '/start_old=*/'d $clashdir/mark
|
||||
echo start_old=已开启 >> $clashdir/mark
|
||||
setconfig start_old 已开启
|
||||
fi
|
||||
fi
|
||||
#修饰文件及版本号
|
||||
shtype=sh && [ -n "$(ls -l /bin/sh|grep -oE 'dash|show|bash')" ] && shtype=bash
|
||||
sed -i "s|/bin/sh|/bin/$shtype|" $clashdir/start.sh
|
||||
chmod 777 $clashdir/start.sh
|
||||
sed -i '/versionsh_l=*/'d $clashdir/mark
|
||||
echo versionsh_l=$release_new >> $clashdir/mark
|
||||
chmod 755 $clashdir/start.sh
|
||||
setconfig versionsh_l $release_new
|
||||
#设置更新地址
|
||||
sed -i '/update_url=*/'d $clashdir/mark
|
||||
echo update_url=$url >> $clashdir/mark
|
||||
[ -n "$url" ] && setconfig update_url $url
|
||||
#设置环境变量
|
||||
[ -w /opt/etc/profile ] && profile=/opt/etc/profile
|
||||
[ -w /jffs/configs/profile.add ] && profile=/jffs/configs/profile.add
|
||||
@@ -126,10 +130,25 @@ gettar(){
|
||||
exit 1
|
||||
fi
|
||||
#华硕/Padavan额外设置
|
||||
[ -n "$systype" ] && sed -i '/ShellClash初始化/'d $initdir && echo "$clashdir/start.sh init #ShellClash初始化脚本" >> $initdir
|
||||
[ -n "$initdir" ] && {
|
||||
sed -i '/ShellClash初始化/'d $initdir && touch $initdir && echo "$clashdir/start.sh init #ShellClash初始化脚本" >> $initdir
|
||||
setconfig initdir $initdir
|
||||
}
|
||||
#小米镜像化OpenWrt额外设置
|
||||
if [ "$systype" = "mi_snapshot" ];then
|
||||
chmod 755 $clashdir/misnap_init.sh
|
||||
uci set firewall.ShellClash=include
|
||||
uci set firewall.ShellClash.type='script'
|
||||
uci set firewall.ShellClash.path='/data/clash/misnap_init.sh'
|
||||
uci set firewall.ShellClash.enabled='1'
|
||||
uci commit firewall
|
||||
setconfig systype $systype
|
||||
else
|
||||
rm -rf $clashdir/misnap_init.sh
|
||||
rm -rf $clashdir/clashservice
|
||||
fi
|
||||
#删除临时文件
|
||||
rm -rf /tmp/clashfm.tar.gz
|
||||
rm -rf $clashdir/clashservice
|
||||
rm -rf $clashdir/clash.service
|
||||
}
|
||||
#下载及安装
|
||||
@@ -149,6 +168,7 @@ setdir(){
|
||||
if [ -n "$systype" ];then
|
||||
[ "$systype" = "Padavan" ] && dir=/etc/storage
|
||||
[ "$systype" = "asusrouter" ] && dir=/jffs
|
||||
[ "$systype" = "mi_snapshot" ] && dir=/data
|
||||
else
|
||||
echo -----------------------------------------------
|
||||
$echo "\033[33m安装ShellClash至少需要预留约1MB的磁盘空间\033[0m"
|
||||
@@ -185,10 +205,11 @@ else
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -w $dir ];then
|
||||
$echo "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" && sleep 1 && setdir
|
||||
else
|
||||
$echo "目标目录\033[32m$dir\033[0m空间剩余:$(df -h $dir | awk '{print $4}' | sed 1d )"
|
||||
$echo "目标目录\033[32m$dir\033[0m空间剩余:$(dir_avail $dir)"
|
||||
read -p "确认安装?(1/0) > " res
|
||||
[ "$res" = "1" ] && clashdir=$dir/clash || setdir
|
||||
fi
|
||||
@@ -197,7 +218,7 @@ fi
|
||||
#输出
|
||||
$echo "最新版本:\033[32m$release_new\033[0m"
|
||||
echo -----------------------------------------------
|
||||
$echo "\033[44m如遇问题请加TG群反馈:\033[42;30m t.me/clashfm \033[0m"
|
||||
$echo "\033[44m如遇问题请加TG群反馈:\033[42;30m t.me/ShellClash \033[0m"
|
||||
$echo "\033[37m支持各种基于openwrt的路由器设备"
|
||||
$echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m"
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ ruleset=🛑 广告拦截,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🛑 广告拦截,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/BanProgramAD.list
|
||||
ruleset=📢 谷歌FCM,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/GoogleFCM.list
|
||||
ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/GoogleCN.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 DisneyP,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=Ⓜ️ 微软服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Microsoft.list
|
||||
ruleset=🍎 苹果服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Apple.list
|
||||
ruleset=📲 电报消息,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Telegram.list
|
||||
@@ -17,22 +17,24 @@ ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🎯 全球直连,[]GEOIP,CN
|
||||
ruleset=🐟 漏网之鱼,[]FINAL
|
||||
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]👍 高级节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🚀 手动切换`select`.*
|
||||
custom_proxy_group=♻️ 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🛑 广告拦截`select`[]DIRECT`[]REJECT
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 奈飞解锁`select`[]🎥 流媒体解锁`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 NETFLIX`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🎥 DisneyP`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎯 全球直连`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)`[]🇸🇬 新加坡节点
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|原生|奈飞|解锁|流媒|迪士尼|N.*D|Netflix|NETFLIX|Media|Disn|Unlock)
|
||||
custom_proxy_group=📺 省流节点`url-test`(0\.[0-5]|低倍率|省流|大流量)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=👍 高级节点`url-test`(专线|专用|高级|直连|急速|高倍率|IEPL|IPLC|AIA|CTM|CC|iepl|iplc|aia|ctm|cc)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇭🇰 香港节点`url-test`(港|HK|Hong Kong)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇰 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇵 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇺🇲 美国节点`url-test`(美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States)`http://www.gstatic.com/generate_204`300,,150
|
||||
custom_proxy_group=🇨🇳 台湾节点`url-test`(台|新北|彰化|TW|Taiwan)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇸🇬 新加坡节点`url-test`(新加坡|坡|狮城|SG|Singapore)`http://www.gstatic.com/generate_204`300,,50
|
||||
|
||||
@@ -7,9 +7,9 @@ ruleset=🆎 增强拦截,rules/ACL4SSR/Clash/BanEasyListChina.list
|
||||
ruleset=🆎 增强拦截,rules/ACL4SSR/Clash/BanEasyPrivacy.list
|
||||
ruleset=📢 谷歌FCM,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/GoogleFCM.list
|
||||
ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/GoogleCN.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 DisneyP,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=Ⓜ️ 微软服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Microsoft.list
|
||||
ruleset=🍎 苹果服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Apple.list
|
||||
ruleset=📲 电报消息,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Telegram.list
|
||||
@@ -20,24 +20,26 @@ ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🎯 全球直连,[]GEOIP,CN
|
||||
ruleset=🐟 漏网之鱼,[]FINAL
|
||||
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]👍 高级节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🚀 手动切换`select`.*
|
||||
custom_proxy_group=♻️ 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🛑 广告拦截`select`[]REJECT`[]DIRECT
|
||||
custom_proxy_group=🍃 应用净化`select`[]REJECT`[]DIRECT
|
||||
custom_proxy_group=🆎 增强拦截`select`[]DIRECT`[]REJECT
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 奈飞解锁`select`[]🎥 流媒体解锁`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 NETFLIX`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🎥 DisneyP`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎯 全球直连`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)`[]🇸🇬 新加坡节点
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|原生|奈飞|解锁|流媒|迪士尼|N.*D|Netflix|NETFLIX|Media|Disn|Unlock)
|
||||
custom_proxy_group=📺 省流节点`url-test`(0\.[0-5]|低倍率|省流|大流量)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=👍 高级节点`url-test`(专线|专用|高级|直连|急速|高倍率|IEPL|IPLC|AIA|CTM|CC|iepl|iplc|aia|ctm|cc)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇭🇰 香港节点`url-test`(港|HK|Hong Kong)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇰 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇵 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇺🇲 美国节点`url-test`(美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States)`http://www.gstatic.com/generate_204`300,,150
|
||||
custom_proxy_group=🇨🇳 台湾节点`url-test`(台|新北|彰化|TW|Taiwan)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇸🇬 新加坡节点`url-test`(新加坡|坡|狮城|SG|Singapore)`http://www.gstatic.com/generate_204`300,,50
|
||||
|
||||
@@ -5,11 +5,11 @@ ruleset=🛑 广告拦截,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🍃 应用净化,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/BanProgramAD.list
|
||||
ruleset=📢 谷歌FCM,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/GoogleFCM.list
|
||||
ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/GoogleCN.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=📺 哔哩哔哩,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/BilibiliHMT.list
|
||||
ruleset=📺 哔哩哔哩,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Bilibili.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 DisneyP,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=🎥 YouTube,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/YouTube.list
|
||||
ruleset=📺 哔哩海外,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/BilibiliHMT.list
|
||||
ruleset=Ⓜ️ 微软服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Microsoft.list
|
||||
ruleset=🍎 苹果服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Apple.list
|
||||
ruleset=📲 电报消息,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Telegram.list
|
||||
@@ -25,29 +25,33 @@ ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🎯 全球直连,[]GEOIP,CN
|
||||
ruleset=🐟 漏网之鱼,[]FINAL
|
||||
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]👍 高级节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🚀 手动切换`select`.*
|
||||
custom_proxy_group=♻️ 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🛑 广告拦截`select`[]DIRECT`[]REJECT
|
||||
custom_proxy_group=🍃 应用净化`select`[]DIRECT`[]REJECT
|
||||
custom_proxy_group=🎮 外服游戏`select`[]🎯 全球直连`[]🎮 游戏节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 奈飞解锁`select`[]🎥 流媒体解锁`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🌏 国内媒体`select`[]DIRECT`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=📺 哔哩哔哩`select`[]🎯 全球直连`[]🇨🇳 台湾节点`[]🇭🇰 香港节点
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎮 外服游戏`select`[]🎯 全球直连`[]🎮 游戏节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 NETFLIX`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🎥 DisneyP`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🎥 YouTube`select`[]📺 省流节点`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=📺 哔哩海外`select`[]🎯 全球直连`[]🇨🇳 台湾节点`[]🇭🇰 香港节点
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🌏 国内媒体`select`[]DIRECT`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=📺 巴哈姆特`select`[]🇨🇳 台湾节点`[]🚀 节点选择`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🎶 网易音乐`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择`(网易|音乐|解锁|Music|NetEase)
|
||||
custom_proxy_group=🎯 全球直连`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎮 游戏节点`select`(游戏|Game|game|加速)`
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)`[]🇸🇬 新加坡节点
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)
|
||||
custom_proxy_group=📺 省流节点`url-test`(0\.[0-5]|低倍率|省流|大流量)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=👍 高级节点`url-test`(专线|专用|高级|直连|急速|高倍率|IEPL|IPLC|AIA|CTM|CC|iepl|iplc|aia|ctm|cc)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇭🇰 香港节点`url-test`(港|HK|Hong Kong)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇰 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇵 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇺🇲 美国节点`url-test`(美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States)`http://www.gstatic.com/generate_204`300,,150
|
||||
custom_proxy_group=🇨🇳 台湾节点`url-test`(台|新北|彰化|TW|Taiwan)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇸🇬 新加坡节点`url-test`(新加坡|坡|狮城|SG|Singapore)`http://www.gstatic.com/generate_204`300,,50
|
||||
|
||||
@@ -8,11 +8,11 @@ ruleset=🆎 增强拦截,rules/ACL4SSR/Clash/BanEasyListChina.list
|
||||
ruleset=🆎 增强拦截,rules/ACL4SSR/Clash/BanEasyPrivacy.list
|
||||
ruleset=📢 谷歌FCM,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/GoogleFCM.list
|
||||
ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/GoogleCN.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=📺 哔哩哔哩,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/BilibiliHMT.list
|
||||
ruleset=📺 哔哩哔哩,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Bilibili.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 DisneyP,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=🎥 YouTube,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/YouTube.list
|
||||
ruleset=📺 哔哩海外,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/BilibiliHMT.list
|
||||
ruleset=Ⓜ️ 微软服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Microsoft.list
|
||||
ruleset=🍎 苹果服务,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Apple.list
|
||||
ruleset=📲 电报消息,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Telegram.list
|
||||
@@ -28,30 +28,33 @@ ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🎯 全球直连,[]GEOIP,CN
|
||||
ruleset=🐟 漏网之鱼,[]FINAL
|
||||
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]👍 高级节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🚀 手动切换`select`.*
|
||||
custom_proxy_group=♻️ 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🛑 广告拦截`select`[]REJECT`[]DIRECT
|
||||
custom_proxy_group=🍃 应用净化`select`[]REJECT`[]DIRECT
|
||||
custom_proxy_group=🆎 增强拦截`select`[]DIRECT`[]REJECT
|
||||
custom_proxy_group=🎮 外服游戏`select`[]🎯 全球直连`[]🎮 游戏节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 奈飞解锁`select`[]🎥 流媒体解锁`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🌏 国内媒体`select`[]DIRECT`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=📺 哔哩哔哩`select`[]🎯 全球直连`[]🇨🇳 台湾节点`[]🇭🇰 香港节点
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎮 外服游戏`select`[]🎯 全球直连`[]🎮 游戏节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=📲 电报消息`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=📢 谷歌FCM`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎥 NETFLIX`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🎥 DisneyP`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=🎥 YouTube`select`[]📺 省流节点`[]👍 高级节点`[]🇸🇬 新加坡节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 节点选择
|
||||
custom_proxy_group=📺 哔哩海外`select`[]🎯 全球直连`[]🇨🇳 台湾节点`[]🇭🇰 香港节点
|
||||
custom_proxy_group=🌍 国外媒体`select`[]🚀 节点选择`[]♻️ 自动选择`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🌏 国内媒体`select`[]DIRECT`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=Ⓜ️ 微软服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=🍎 苹果服务`select`[]DIRECT`[]🚀 节点选择`[]🇺🇲 美国节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🚀 手动切换
|
||||
custom_proxy_group=📺 巴哈姆特`select`[]🇨🇳 台湾节点`[]🚀 节点选择`[]🚀 手动切换`[]DIRECT
|
||||
custom_proxy_group=🎶 网易音乐`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择`(网易|音乐|解锁|Music|NetEase)
|
||||
custom_proxy_group=🎯 全球直连`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇰 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]♻️ 自动选择`[]DIRECT`[]📺 省流节点`[]🇭🇰 香港节点`[]🇨🇳 台湾节点`[]🇸🇬 新加坡节点`[]🇯🇵 日韩节点`[]🇺🇲 美国节点`[]🚀 手动切换
|
||||
custom_proxy_group=🎮 游戏节点`select`(游戏|Game|game|加速)`
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)`[]🇸🇬 新加坡节点
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)
|
||||
custom_proxy_group=📺 省流节点`url-test`(0\.[0-5]|低倍率|省流|大流量)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=👍 高级节点`url-test`(专线|专用|高级|直连|急速|高倍率|IEPL|IPLC|AIA|CTM|CC|iepl|iplc|aia|ctm|cc)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇭🇰 香港节点`url-test`(港|HK|Hong Kong)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇰 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇯🇵 日韩节点`url-test`(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan|KR|Korea|KOR|首尔|韩|韓)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇺🇲 美国节点`url-test`(美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States)`http://www.gstatic.com/generate_204`300,,150
|
||||
custom_proxy_group=🇨🇳 台湾节点`url-test`(台|新北|彰化|TW|Taiwan)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🇸🇬 新加坡节点`url-test`(新加坡|坡|狮城|SG|Singapore)`http://www.gstatic.com/generate_204`300,,50
|
||||
|
||||
@@ -12,14 +12,16 @@ ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🎯 全球直连,[]GEOIP,CN
|
||||
ruleset=🐟 漏网之鱼,[]FINAL
|
||||
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`select`.*
|
||||
custom_proxy_group=🚀 节点选择`select`[]♻️ 自动选择`[]📺 省流节点`[]👍 高级节点`select`.*
|
||||
custom_proxy_group=♻️ 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=🔯 故障转移`fallback`[]🚀 节点选择`[]♻️ 自动选择`http://www.gstatic.com/generate_204`180
|
||||
custom_proxy_group=🛑 广告拦截`select`[]DIRECT`[]REJECT
|
||||
custom_proxy_group=🎥 奈飞解锁`select`[]🎥 流媒体解锁`[]🚀 节点选择
|
||||
custom_proxy_group=🎥 奈飞解锁`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🔯 故障转移`[]🚀 节点选择
|
||||
custom_proxy_group=🎯 全球直连`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🚀 节点选择`[]📺 省流节点`[]♻️ 自动选择`[]DIRECT
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)`[]🚀 节点选择
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🔯 故障转移`[]🚀 节点选择`[]📺 省流节点`[]♻️ 自动选择`[]DIRECT
|
||||
custom_proxy_group=🎥 流媒体解锁`select`(NF|奈飞|解锁|Netflix|NETFLIX|Media)
|
||||
custom_proxy_group=📺 省流节点`url-test`(0\.[0-5]|低倍率|省流|大流量)`http://www.gstatic.com/generate_204`300,,50
|
||||
custom_proxy_group=👍 高级节点`url-test`(专线|专用|高级|直连|急速|高倍率|IEPL|IPLC|AIA|CTM|CC|iepl|iplc|aia|ctm|cc)`http://www.gstatic.com/generate_204`300,,50
|
||||
|
||||
enable_rule_generator=true
|
||||
overwrite_original_rules=true
|
||||
|
||||
@@ -5,7 +5,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
ExecStart=/etc/clash/clash -d /etc/clash
|
||||
ExecStart=/etc/clash/clash -d /etc/clash >/dev/null
|
||||
ExecStartPost=/etc/clash/start.sh afstart
|
||||
Restart=on-failure
|
||||
RestartSec=3s
|
||||
@@ -13,4 +13,4 @@ LimitNOFILE=999999
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
||||
|
||||
328
scripts/clash.sh
328
scripts/clash.sh
@@ -4,7 +4,7 @@
|
||||
#读取配置相关
|
||||
getconfig(){
|
||||
#服务器缺省地址
|
||||
[ -z "$update_url" ] && update_url=https://cdn.jsdelivr.net/gh/juewuy/ShellClash
|
||||
[ -z "$update_url" ] && update_url=https://raw.githubusercontents.com/juewuy/ShellClash
|
||||
#文件路径
|
||||
[ -z "$clashdir" ] && echo 环境变量配置有误!请重新安装脚本!
|
||||
ccfg=$clashdir/mark
|
||||
@@ -22,7 +22,7 @@ getconfig(){
|
||||
[ -z "$redir_port" ] && redir_port=7892
|
||||
[ -z "$db_port" ] && db_port=9999
|
||||
[ -z "$dns_port" ] && dns_port=1053
|
||||
[ -z "$multiport" ] && multiport='53,587,465,995,993,143,80,443'
|
||||
[ -z "$multiport" ] && multiport='22,53,587,465,995,993,143,80,443,8080'
|
||||
[ -z "$local_proxy" ] && local_proxy=未开启
|
||||
#检查mac地址记录
|
||||
[ ! -f $clashdir/mac ] && touch $clashdir/mac
|
||||
@@ -35,26 +35,21 @@ getconfig(){
|
||||
[ -d /www/clash ] && dbdir=/www/clash && hostdir=/clash
|
||||
#开机自启检测
|
||||
if [ -f /etc/rc.common ];then
|
||||
[ -n "$(find /etc/rc.d -name '*clash')" ] && autostart=enable_rc || autostart=disable_rc
|
||||
[ -n "$(find /etc/rc.d -name '*clash')" ] && autostart=enable || autostart=disable
|
||||
elif [ -w /etc/systemd/system -o -w /usr/lib/systemd/system ];then
|
||||
[ -n "$(systemctl is-enabled clash.service 2>&1 | grep enable)" ] && autostart=enable_sys || autostart=disable_sys
|
||||
[ -n "$(systemctl is-enabled clash.service 2>&1 | grep enable)" ] && autostart=enable || autostart=disable
|
||||
else
|
||||
[ -f $clashdir/.dis_startup ] && autostart=disable || autostart=enable
|
||||
fi
|
||||
#开机自启描述
|
||||
if [ "$start_old" = "已开启" ]; then
|
||||
auto="\033[32m保守模式\033[0m"
|
||||
auto1="代理本机:\033[36m$local_proxy\033[0m"
|
||||
elif [ "$autostart" = "enable_rc" -o "$autostart" = "enable_sys" ]; then
|
||||
if [ "$autostart" = "enable" ]; then
|
||||
auto="\033[32m已设置开机启动!\033[0m"
|
||||
auto1="\033[36m禁用\033[0mclash开机启动"
|
||||
elif [ "$autostart" = "disable_rc" -o "$autostart" = "disable_sys" ]; then
|
||||
else
|
||||
auto="\033[31m未设置开机启动!\033[0m"
|
||||
auto1="\033[36m允许\033[0mclash开机启动"
|
||||
else
|
||||
auto="\033[32m保守模式\033[0m"
|
||||
auto1="代理本机:\033[36m$local_proxy\033[0m"
|
||||
fi
|
||||
#获取运行模式
|
||||
[ -z "$redir_mod" ] && [ "$USER" = "root" -o "$USER" = "admin" ] && redir_mod=Redir模式
|
||||
[ -z "$redir_mod" ] && redir_mod=纯净模式
|
||||
#获取运行状态
|
||||
PID=$(pidof clash)
|
||||
@@ -80,7 +75,7 @@ getconfig(){
|
||||
if [ -n "$PID" ];then
|
||||
echo -e "当前内存占用:\033[44m"$VmRSS"\033[0m,已运行:\033[46;30m"$day"\033[44;37m"$time"\033[0m"
|
||||
fi
|
||||
echo -e "TG群:\033[36;4mhttps://t.me/clashfm\033[0m"
|
||||
echo -e "TG频道:\033[36;4mhttps://t.me/ShellClash\033[0m"
|
||||
echo -----------------------------------------------
|
||||
#检查新手引导
|
||||
if [ -z "$userguide" ];then
|
||||
@@ -136,7 +131,7 @@ checkrestart(){
|
||||
}
|
||||
#功能相关
|
||||
setport(){
|
||||
getconfig
|
||||
source $ccfg
|
||||
[ -z "$secret" ] && secret=未设置
|
||||
[ -z "$authentication" ] && authentication=未设置
|
||||
inputport(){
|
||||
@@ -187,9 +182,9 @@ setport(){
|
||||
setconfig authentication
|
||||
echo 密码已移除!
|
||||
else
|
||||
if [ "$local_proxy" = "已开启" ];then
|
||||
if [ "$local_proxy" = "已开启" -a "$local_type" = "环境变量" ];then
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m请先禁用本机代理功能!\033[0m"
|
||||
echo -e "\033[33m请先禁用本机代理功能或使用增强模式!\033[0m"
|
||||
sleep 1
|
||||
else
|
||||
authentication=$(echo $input | grep :)
|
||||
@@ -236,7 +231,7 @@ setport(){
|
||||
setport
|
||||
elif [ "$num" = 8 ]; then
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m此处可以更改脚本内置的host地址\033[0m"
|
||||
echo -e "\033[33m此处可以更改脚本内置的局域网设备IP地址\033[0m"
|
||||
echo -e "\033[31m设置后如本机host地址有变动,请务必手动修改!\033[0m"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入自定义host地址(输入0移除自定义host) > " host
|
||||
@@ -377,7 +372,7 @@ checkport(){
|
||||
if [ -n "$(netstat -ntul 2>&1 |grep \:$portx\ )" ];then
|
||||
echo -----------------------------------------------
|
||||
echo -e "检测到端口【$portx】被以下进程占用!clash可能无法正常启动!\033[33m"
|
||||
echo $(netstat -ntulp | grep :$portx | head -n 1)
|
||||
echo $(netstat -ntul | grep :$portx | head -n 1)
|
||||
echo -e "\033[0m-----------------------------------------------"
|
||||
echo -e "\033[36m请修改默认端口配置!\033[0m"
|
||||
setport
|
||||
@@ -525,8 +520,8 @@ localproxy(){
|
||||
echo -e "\033[33m当前本机代理配置方式为:\033[32m$local_type\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 \033[36m$proxy_set本机代理\033[0m"
|
||||
echo -e " 2 使用\033[32m环境变量\033[0m方式配置"
|
||||
echo -e " 3 使用\033[32miptables增强模式\033[0m配置(仅支持Linux系统)"
|
||||
echo -e " 2 使用\033[32m环境变量\033[0m方式配置(部分应用可能无法使用)"
|
||||
echo -e " 3 使用\033[32miptables增强模式\033[0m配置(仅支持Linux系统)"
|
||||
echo -e " 0 返回上级菜单"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
@@ -581,6 +576,11 @@ clashcfg(){
|
||||
set_redir_config(){
|
||||
setconfig redir_mod $redir_mod
|
||||
setconfig dns_mod $dns_mod
|
||||
if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ] && [ "$clashcore" = "clash" ];then
|
||||
rm -rf $bindir/clash
|
||||
rm -rf $clashdir/clash
|
||||
setconfig clashcore clash.meta
|
||||
fi
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[36m已设为 $redir_mod !!\033[0m"
|
||||
}
|
||||
@@ -698,13 +698,41 @@ clashcfg(){
|
||||
errornum
|
||||
fi
|
||||
}
|
||||
|
||||
fake_ip_filter(){
|
||||
echo -e "\033[32m用于解决Fake-ip模式下部分地址或应用无法连接的问题\033[0m"
|
||||
echo -e "\033[31m脚本已经内置了大量地址,你只需要添加出现问题的地址!\033[0m"
|
||||
echo -e "\033[36m示例:a.b.com"
|
||||
echo -e "示例:*.b.com"
|
||||
echo -e "示例:*.*.b.com\033[0m"
|
||||
echo -----------------------------------------------
|
||||
if [ -f $clashdir/fake_ip_filter ];then
|
||||
echo -e "\033[33m已添加Fake-ip过滤地址:\033[0m"
|
||||
cat $clashdir/fake_ip_filter | awk '{print NR" "$1}'
|
||||
else
|
||||
echo -e "\033[33m你还未添加Fake-ip过滤地址\033[0m"
|
||||
fi
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m输入数字直接移除对应地址,输入地址直接添加!\033[0m"
|
||||
read -p "请输入数字或地址 > " input
|
||||
if [ -z "$input" -o "input" = 0 ];then
|
||||
i=
|
||||
elif [ "$input" -le "$(cat $clashdir/fake_ip_filter | wc -l)" ];then
|
||||
sed -i "${input}d" $clashdir/fake_ip_filter 2>/dev/null
|
||||
echo -e "\033[32m移除成功!\033[0m"
|
||||
fake_ip_filter
|
||||
else
|
||||
echo -e "你输入的地址是:\033[32m$input\033[0m"
|
||||
read -p "确认添加?(1/0) > " res
|
||||
[ "$res" = 1 ] && echo $input >> $clashdir/fake_ip_filter || fake_ip_filter
|
||||
fi
|
||||
}
|
||||
#获取设置默认显示
|
||||
[ -z "$skip_cert" ] && skip_cert=已开启
|
||||
[ -z "$common_ports" ] && common_ports=已开启
|
||||
[ -z "$dns_mod" ] && dns_mod=redir_host
|
||||
[ -z "$dns_over" ] && dns_over=已开启
|
||||
[ -z "$cn_ip_route" ] && cn_ip_route=未开启
|
||||
[ -z "$quic_rj" ] && quic_rj=未开启
|
||||
[ -z "$(cat $clashdir/mac)" ] && mac_return=未开启 || mac_return=已启用
|
||||
#
|
||||
echo -----------------------------------------------
|
||||
@@ -716,7 +744,10 @@ clashcfg(){
|
||||
echo -e " 4 只代理常用端口: \033[36m$common_ports\033[0m ————用于过滤P2P流量"
|
||||
echo -e " 5 过滤局域网设备: \033[36m$mac_return\033[0m ————使用黑/白名单进行过滤"
|
||||
echo -e " 6 设置本机代理服务: \033[36m$local_proxy\033[0m ————使本机流量经过clash内核"
|
||||
echo -e " 7 CN_IP绕过内核: \033[36m$cn_ip_route\033[0m ————优化性能,不兼容Fake-ip"
|
||||
echo -e " 7 屏蔽QUIC流量: \033[36m$quic_rj\033[0m ————优化视频性能"
|
||||
[ "$dns_mod" = "fake-ip" ] && \
|
||||
echo -e " 8 管理Fake-ip过滤列表" || \
|
||||
echo -e " 8 CN_IP绕过内核: \033[36m$cn_ip_route\033[0m ————优化性能,不兼容Fake-ip"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 0 返回上级菜单 \033[0m"
|
||||
echo -----------------------------------------------
|
||||
@@ -753,7 +784,7 @@ clashcfg(){
|
||||
|
||||
elif [ "$num" = 4 ]; then
|
||||
echo -----------------------------------------------
|
||||
if [ "$common_ports" = "未开启" ] > /dev/null 2>&1; then
|
||||
if [ "$common_ports" = "未开启" ]; then
|
||||
echo -e "\033[33m已设为仅代理【$multiport】等常用端口!!\033[0m"
|
||||
common_ports=已开启
|
||||
else
|
||||
@@ -772,27 +803,44 @@ clashcfg(){
|
||||
sleep 1
|
||||
clashcfg
|
||||
|
||||
elif [ "$num" = 7 ]; then
|
||||
elif [ "$num" = 7 ]; then
|
||||
echo -----------------------------------------------
|
||||
if ! ipset -v >/dev/null 2>&1;then
|
||||
echo -e "\033[31m当前设备缺少ipset模块,无法启用绕过功能!!\033[0m"
|
||||
sleep 1
|
||||
elif [ "$dns_mod" = "fake-ip" ];then
|
||||
echo -e "\033[31m不支持fake-ip模式,请将DNS模式更换为Redir-host!!\033[0m"
|
||||
sleep 1
|
||||
if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" -o "$tproxy_mod" = "已开启" ];then
|
||||
if [ "$quic_rj" = "未开启" ]; then
|
||||
echo -e "\033[33m已禁止QUCI流量通过clash内核!!\033[0m"
|
||||
quic_rj=已启用
|
||||
else
|
||||
echo -e "\033[33m已取消禁止QUIC协议流量!!\033[0m"
|
||||
quic_rj=未开启
|
||||
fi
|
||||
setconfig quic_rj $quic_rj
|
||||
else
|
||||
echo -e "\033[33m当前模式默认不会代理UDP流量,无需设置!!\033[0m"
|
||||
fi
|
||||
clashcfg
|
||||
|
||||
elif [ "$num" = 8 ]; then
|
||||
echo -----------------------------------------------
|
||||
if [ "$dns_mod" = "fake-ip" ];then
|
||||
fake_ip_filter
|
||||
clashcfg
|
||||
else
|
||||
if [ "$cn_ip_route" = "未开启" ]; then
|
||||
echo -e "\033[32m已开启CN_IP绕过内核功能!!\033[0m"
|
||||
cn_ip_route=已开启
|
||||
if ! ipset -v >/dev/null 2>&1;then
|
||||
echo -e "\033[31m当前设备缺少ipset模块,无法启用绕过功能!!\033[0m"
|
||||
sleep 1
|
||||
else
|
||||
echo -e "\033[33m已禁用CN_IP绕过内核功能!!\033[0m"
|
||||
cn_ip_route=未开启
|
||||
if [ "$cn_ip_route" = "未开启" ]; then
|
||||
echo -e "\033[32m已开启CN_IP绕过内核功能!!\033[0m"
|
||||
cn_ip_route=已开启
|
||||
sleep 1
|
||||
else
|
||||
echo -e "\033[33m已禁用CN_IP绕过内核功能!!\033[0m"
|
||||
cn_ip_route=未开启
|
||||
fi
|
||||
setconfig cn_ip_route $cn_ip_route
|
||||
fi
|
||||
setconfig cn_ip_route $cn_ip_route
|
||||
fi
|
||||
clashcfg
|
||||
clashcfg
|
||||
|
||||
elif [ "$num" = 9 ]; then
|
||||
clashstart
|
||||
@@ -813,7 +861,7 @@ clashadv(){
|
||||
echo -e "\033[30;47m欢迎使用进阶模式菜单:\033[0m"
|
||||
echo -e "\033[33m如您并不了解clash的运行机制,请勿更改本页面功能!\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 使用保守方式启动: \033[36m$start_old\033[0m ————切换时会停止clash服务"
|
||||
echo -e " 1 使用保守模式启动: \033[36m$start_old\033[0m ————切换时会停止clash服务"
|
||||
echo -e " 2 启用ipv6支持: \033[36m$ipv6_support\033[0m ————实验性功能,可能不稳定"
|
||||
echo -e " 3 Redir模式udp转发: \033[36m$tproxy_mod\033[0m ————依赖iptables-mod-tproxy"
|
||||
echo -e " 4 启用小闪存模式: \033[36m$mini_clash\033[0m ————不保存核心及数据库文件"
|
||||
@@ -830,6 +878,28 @@ clashadv(){
|
||||
errornum
|
||||
elif [ "$num" = 0 ]; then
|
||||
i=
|
||||
elif [ "$num" = 1 ]; then
|
||||
echo -----------------------------------------------
|
||||
if [ "$start_old" = "未开启" ] > /dev/null 2>&1; then
|
||||
echo -e "\033[33m改为使用保守模式启动clash服务!!\033[0m"
|
||||
echo -e "\033[31m注意:部分设备保守模式可能无法禁用开机启动!!\033[0m"
|
||||
start_old=已开启
|
||||
setconfig start_old $start_old
|
||||
$clashdir/start.sh stop
|
||||
else
|
||||
if [ -f /etc/init.d/clash -o -w /etc/systemd/system -o -w /usr/lib/systemd/system ];then
|
||||
echo -e "\033[32m改为使用默认方式启动clash服务!!\033[0m"
|
||||
$clashdir/start.sh cronset "ShellClash初始化"
|
||||
start_old=未开启
|
||||
setconfig start_old $start_old
|
||||
$clashdir/start.sh stop
|
||||
|
||||
else
|
||||
echo -e "\033[31m当前设备不支持以其他模式启动!!\033[0m"
|
||||
fi
|
||||
fi
|
||||
sleep 1
|
||||
clashadv
|
||||
|
||||
elif [ "$num" = 2 ]; then
|
||||
echo -----------------------------------------------
|
||||
@@ -843,29 +913,7 @@ clashadv(){
|
||||
ipv6_support=未开启
|
||||
fi
|
||||
setconfig ipv6_support $ipv6_support
|
||||
clashadv
|
||||
|
||||
elif [ "$num" = 1 ]; then
|
||||
echo -----------------------------------------------
|
||||
if [ "$start_old" = "未开启" ] > /dev/null 2>&1; then
|
||||
echo -e "\033[33m改为使用保守方式启动clash服务!!\033[0m"
|
||||
echo -e "\033[36m此模式兼容性更好但无法禁用开机启动!!\033[0m"
|
||||
start_old=已开启
|
||||
setconfig start_old $start_old
|
||||
$clashdir/start.sh stop
|
||||
sleep 2
|
||||
else
|
||||
if [ -f /etc/init.d/clash -o -w /etc/systemd/system -o -w /usr/lib/systemd/system ];then
|
||||
echo -e "\033[32m改为使用默认方式启动clash服务!!\033[0m"
|
||||
start_old=未开启
|
||||
setconfig start_old $start_old
|
||||
$clashdir/start.sh stop
|
||||
else
|
||||
echo -e "\033[31m当前设备不支持以其他模式启动!!\033[0m"
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
clashadv
|
||||
clashadv
|
||||
|
||||
elif [ "$num" = 3 ]; then
|
||||
echo -----------------------------------------------
|
||||
@@ -960,10 +1008,8 @@ clashadv(){
|
||||
elif [ "$num" = 7 ]; then
|
||||
[ ! -f $clashdir/user.yaml ] && cat > $clashdir/user.yaml <<EOF
|
||||
#用于编写自定义设定(可参考https://lancellc.gitbook.io/clash),例如
|
||||
#新版已经支持直接读取系统hosts(/etc/hosts)并写入配置文件,无需在此处添加!
|
||||
#port: 7890
|
||||
#hosts:
|
||||
# '*.clash.dev': 127.0.0.1
|
||||
# 'alpha.clash.dev': ::1
|
||||
EOF
|
||||
[ ! -f $clashdir/rules.yaml ] && cat > $clashdir/rules.yaml <<EOF
|
||||
#用于编写自定义规则(此处规则将优先生效),(可参考https://lancellc.gitbook.io/clash/clash-config-file/rules):
|
||||
@@ -1096,10 +1142,15 @@ streaming(){
|
||||
}
|
||||
tools(){
|
||||
ssh_tools(){
|
||||
[ -n "$(cat /etc/firewall.user 2>1 | grep '启用外网访问SSH服务')" ] && ssh_ol=禁止 || ssh_ol=开启
|
||||
stop_iptables(){
|
||||
iptables -t nat -D PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 >/dev/null 2>&1
|
||||
ip6tables -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 >/dev/null 2>&1
|
||||
}
|
||||
[ -n "$(cat /etc/firewall.user 2>&1 | grep '启用外网访问SSH服务')" ] && ssh_ol=禁止 || ssh_ol=开启
|
||||
[ -z "$ssh_port" ] && ssh_port=10022
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m此功能仅针对使用Openwrt系统的设备生效,且不依赖clash服务\033[0m"
|
||||
echo -e "\033[31m本功能不支持红米AX6S等镜像化系统设备,请勿尝试!\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 \033[32m修改\033[0m外网访问端口:\033[36m$ssh_port\033[0m"
|
||||
echo -e " 2 \033[32m修改\033[0mSSH访问密码(请连续输入2次后回车)"
|
||||
@@ -1125,6 +1176,7 @@ tools(){
|
||||
ssh_port=$num
|
||||
setconfig ssh_port $ssh_port
|
||||
sed -i "/启用外网访问SSH服务/d" /etc/firewall.user
|
||||
stop_iptables
|
||||
echo -e "\033[32m设置成功,请重新开启外网访问SSH功能!!!\033[0m"
|
||||
fi
|
||||
sleep 1
|
||||
@@ -1138,11 +1190,14 @@ tools(){
|
||||
elif [ "$num" = 3 ]; then
|
||||
if [ "$ssh_ol" = "开启" ];then
|
||||
iptables -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22
|
||||
[ -n "$(command -v ip6tables)" ] && ip6tables -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22
|
||||
echo "iptables -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 #启用外网访问SSH服务" >> /etc/firewall.user
|
||||
[ -n "$(command -v ip6tables)" ] && echo "ip6tables -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 #启用外网访问SSH服务" >> /etc/firewall.user
|
||||
echo -----------------------------------------------
|
||||
echo -e "已开启外网访问SSH功能!"
|
||||
else
|
||||
sed -i "/启用外网访问SSH服务/d" /etc/firewall.user
|
||||
stop_iptables
|
||||
echo -----------------------------------------------
|
||||
echo -e "已禁止外网访问SSH!"
|
||||
fi
|
||||
@@ -1151,7 +1206,8 @@ tools(){
|
||||
fi
|
||||
}
|
||||
#获取设置默认显示
|
||||
[ -n "$(cat /etc/crontabs/root 2>1| grep otapredownload)" ] && mi_update=禁用 || mi_update=启用
|
||||
[ -n "$(cat /etc/crontabs/root 2>&1| grep otapredownload)" ] && mi_update=禁用 || mi_update=启用
|
||||
[ "$mi_autoSSH" = "已启用" ] && mi_autoSSH_type=32m已启用 || mi_autoSSH_type=31m未启用
|
||||
#
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[30;47m欢迎使用其他工具菜单:\033[0m"
|
||||
@@ -1160,12 +1216,13 @@ tools(){
|
||||
du -sh $clashdir
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 ShellClash测试菜单"
|
||||
[ -f "/etc/firewall.user" ] && echo -e " 2 \033[32m配置\033[0m外网访问SSH"
|
||||
#echo -e " 3 配置DDNS服务: \033[36m$ipv6_support\033[0m ————待施工"
|
||||
[ -x /usr/sbin/otapredownload ] && echo -e " 3 \033[33m$mi_update\033[0m小米系统自动更新"
|
||||
echo -e " 4 \033[32m流媒体预解析\033[0m————用于解决DNS解锁在TV应用上失效的问题"
|
||||
[ -f /etc/firewall.user ] && echo -e " 2 \033[32m配置\033[0m外网访问SSH"
|
||||
[ -f /etc/config/ddns -a -d "/etc/ddns" ] && echo -e " 3 配置DDNS服务(需下载相关脚本)"
|
||||
echo -e " 4 \033[32m流媒体增强\033[0m————用于解决流媒体解锁在TV应用上失效的问题"
|
||||
[ -x /usr/sbin/otapredownload ] && echo -e " 5 \033[33m$mi_update\033[0m小米系统自动更新"
|
||||
[ -f /usr/sbin/otapredownload ] && echo -e " 6 小米设备软固化SSH ———— \033[$mi_autoSSH_type \033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 0 返回上级菜单 \033[0m"
|
||||
echo -e " 0 返回上级菜单"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" ]; then
|
||||
@@ -1181,31 +1238,88 @@ tools(){
|
||||
sleep 1
|
||||
tools
|
||||
|
||||
elif [ -x /usr/sbin/otapredownload ] && [ "$num" = 3 ]; then
|
||||
elif [ "$num" = 3 ]; then
|
||||
echo -----------------------------------------------
|
||||
if [ ! -f $clashdir/ShellDDNS.sh ];then
|
||||
echo -e "正在获取在线脚本……"
|
||||
$clashdir/start.sh webget /tmp/ShellDDNS.sh $update_url/tools/ShellDDNS.sh
|
||||
if [ "$?" = "0" ];then
|
||||
mv -f /tmp/ShellDDNS.sh $clashdir/ShellDDNS.sh
|
||||
source $clashdir/ShellDDNS.sh
|
||||
else
|
||||
echo -e "\033[31m文件下载失败!\033[0m"
|
||||
fi
|
||||
else
|
||||
source $clashdir/ShellDDNS.sh
|
||||
fi
|
||||
sleep 1
|
||||
tools
|
||||
|
||||
elif [ "$num" = 4 ]; then
|
||||
checkcfg=$(cat $ccfg)
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[36m请选择实现方式(不建议同时开启):\033[0m"
|
||||
echo -e " 1 定时预解析流媒体DNS"
|
||||
echo -e " 2 Meta内核专属tls域名嗅探(推荐) \033[33m$sniffer\033[0m"
|
||||
echo -e " 0 返回上级菜单"
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" ]; then
|
||||
errornum
|
||||
elif [ "$num" = 0 ]; then
|
||||
i=
|
||||
elif [ "$num" = 1 ]; then
|
||||
streaming
|
||||
elif [ "$num" = 2 ]; then
|
||||
echo -----------------------------------------------
|
||||
if [ "$sniffer" = "未启用" ];then
|
||||
if [ "$clashcore" != "clash.meta" ];then
|
||||
rm -rf $bindir/clash
|
||||
clashcore=clash.meta
|
||||
setconfig clashcore $clashcore
|
||||
echo "已将clash内核切换为Meta内核!"
|
||||
fi
|
||||
sniffer=已启用
|
||||
else
|
||||
sniffer=未启用
|
||||
fi
|
||||
setconfig sniffer $sniffer
|
||||
echo -e "\033[32m设置成功!\033[0m"
|
||||
sleep 1
|
||||
fi
|
||||
if [ -n "$PID" ];then
|
||||
checkcfg_new=$(cat $ccfg)
|
||||
[ "$checkcfg" != "$checkcfg_new" ] && checkrestart
|
||||
fi
|
||||
tools
|
||||
|
||||
elif [ -x /usr/sbin/otapredownload ] && [ "$num" = 5 ]; then
|
||||
[ "$mi_update" = "禁用" ] && sed -i "/otapredownload/d" /etc/crontabs/root || echo "15 3,4,5 * * * /usr/sbin/otapredownload >/dev/null 2>&1" >> /etc/crontabs/root
|
||||
echo -----------------------------------------------
|
||||
echo -e "已\033[33m$mi_update\033[0m小米路由器的自动启动,如未生效,请在官方APP中同步设置!"
|
||||
sleep 1
|
||||
tools
|
||||
tools
|
||||
|
||||
elif [ "$num" = 4 ]; then
|
||||
nslookup baidu.com > /dev/null 2>&1
|
||||
if [ "$?" = 0 ];then
|
||||
checkcfg=$(cat $ccfg)
|
||||
streaming
|
||||
if [ -n "$PID" ];then
|
||||
checkcfg_new=$(cat $ccfg)
|
||||
[ "$checkcfg" != "$checkcfg_new" ] && checkrestart
|
||||
fi
|
||||
elif [ -f /usr/sbin/otapredownload ] && [ "$num" = 6 ]; then
|
||||
if [ "$mi_autoSSH" = "已启用" ];then
|
||||
mi_autoSSH=禁用
|
||||
else
|
||||
echo -----------------------------------------------
|
||||
echo "当前设备缺少nslookup命令,无法启用全媒体预解析功能!"
|
||||
echo "Centos请尝试使用以下命令安装【yum -y install bind-utils】"
|
||||
echo "Debian/Ubuntu等请尝试使用【sudo apt-get install dnsutils -y】"
|
||||
sleep 1
|
||||
if [ "$systype" = "mi_snapshot" ];then
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m本功能使用软件命令进行固化不保证100%成功!\033[0m"
|
||||
echo -e "本功能需依赖clash服务,请确保clash为开机启动状态!"
|
||||
echo -e "\033[33m如有问题请加群反馈:\033[36;4mhttps://t.me/ShellClash\033[0m"
|
||||
read -p "请输入需要还原的SSH密码(不影响当前密码,回车可跳过) > " mi_autoSSH_pwd
|
||||
mi_autoSSH=已启用
|
||||
cp -f /etc/dropbear/dropbear_rsa_host_key $clashdir/dropbear_rsa_host_key 2>/dev/null
|
||||
echo -e "\033[32m设置成功!\033[0m"
|
||||
sleep 1
|
||||
else
|
||||
echo 不支持的设备!
|
||||
fi
|
||||
fi
|
||||
tools
|
||||
|
||||
setconfig mi_autoSSH $mi_autoSSH
|
||||
setconfig mi_autoSSH_pwd $mi_autoSSH_pwd
|
||||
tools
|
||||
else
|
||||
errornum
|
||||
fi
|
||||
@@ -1219,7 +1333,7 @@ clashcron(){
|
||||
[ ! -w "$crondir" ] && crondir="/etc/storage/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron"
|
||||
[ ! -w "$crondir" ] && echo "你的设备不支持定时任务配置,脚本大量功能无法启用,请前往 https://t.me/clashfm 申请适配!"
|
||||
[ ! -w "$crondir" ] && echo "你的设备不支持定时任务配置,脚本大量功能无法启用,请前往 https://t.me/ShellClash 申请适配!"
|
||||
[ "$1" = "-l" ] && cat $crondir/$USER 2>/dev/null
|
||||
[ -f "$1" ] && cat $1 > $crondir/$USER
|
||||
fi
|
||||
@@ -1302,7 +1416,6 @@ clashcron(){
|
||||
#定时任务菜单
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[30;47m欢迎使用定时任务功能:\033[0m"
|
||||
echo -e "\033[44m 实验性功能,遇问题请加TG群反馈:\033[42;30m t.me/clashfm \033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m已添加的定时任务:\033[36m"
|
||||
croncmd -l | grep -oE ' #.*'
|
||||
@@ -1387,23 +1500,16 @@ clashsh(){
|
||||
|
||||
elif [ "$num" = 4 ]; then
|
||||
echo -----------------------------------------------
|
||||
if [ "$start_old" = "已开启" ];then
|
||||
localproxy
|
||||
elif [ "$autostart" = "enable_rc" ]; then
|
||||
/etc/init.d/clash disable
|
||||
cd /etc/rc.d && rm -rf *clash > /dev/null 2>&1 && cd - >/dev/null
|
||||
if [ "$autostart" = "enable" ]; then
|
||||
[ -d /etc/rc.d ] && cd /etc/rc.d && rm -rf *clash > /dev/null 2>&1 && cd - >/dev/null
|
||||
type systemctl >/dev/null 2>&1 && systemctl disable clash.service > /dev/null 2>&1
|
||||
touch $clashdir/.dis_startup
|
||||
echo -e "\033[33m已禁止Clash开机启动!\033[0m"
|
||||
elif [ "$autostart" = "disable_rc" ]; then
|
||||
/etc/init.d/clash enable
|
||||
elif [ "$autostart" = "disable" ]; then
|
||||
[ -f /etc/rc.common ] && /etc/init.d/clash enable
|
||||
type systemctl >/dev/null 2>&1 && systemctl enable clash.service > /dev/null 2>&1
|
||||
rm -rf $clashdir/.dis_startup
|
||||
echo -e "\033[32m已设置Clash开机启动!\033[0m"
|
||||
elif [ "$autostart" = "enable_sys" ]; then
|
||||
systemctl disable clash.service > /dev/null 2>&1
|
||||
echo -e "\033[33m已禁止Clash开机启动!\033[0m"
|
||||
elif [ "$autostart" = "disable_sys" ]; then
|
||||
systemctl enable clash.service > /dev/null 2>&1
|
||||
echo -e "\033[32m已设置Clash开机启动!\033[0m"
|
||||
else
|
||||
echo -e "\033[32m当前系统不支持设置开启启动!\033[0m"
|
||||
fi
|
||||
clashsh
|
||||
|
||||
@@ -1458,7 +1564,7 @@ case "$1" in
|
||||
echo " $clashdir/start.sh stop 停止服务"
|
||||
echo " $clashdir/start.sh init 写入服务"
|
||||
echo -----------------------------------------
|
||||
echo "在线求助:t.me/clashfm"
|
||||
echo "在线求助:t.me/ShellClash"
|
||||
echo "官方博客:juewuy.github.io"
|
||||
echo "发布页面:github.com/juewuy/ShellClash"
|
||||
echo -----------------------------------------
|
||||
@@ -1467,12 +1573,17 @@ case "$1" in
|
||||
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
|
||||
$shtype -x $clashdir/clash.sh
|
||||
;;
|
||||
-st)
|
||||
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
|
||||
$shtype -x $clashdir/start.sh $2 $3 $4 $5 $6
|
||||
;;
|
||||
-u)
|
||||
read -p "确认卸载ShellClash?(警告:该操作不可逆!)[1/0] " res
|
||||
if [ "$res" = '1' ]; then
|
||||
$clashdir/start.sh stop
|
||||
$clashdir/start.sh cronset "clash服务"
|
||||
$clashdir/start.sh cronset "订阅链接"
|
||||
$clashdir/start.sh cronset "ShellClash初始化"
|
||||
[ -w ~/.bashrc ] && profile=~/.bashrc
|
||||
[ -w /etc/profile ] && profile=/etc/profile
|
||||
sed -i '/alias clash=*/'d $profile
|
||||
@@ -1487,6 +1598,7 @@ case "$1" in
|
||||
rm -rf /etc/systemd/system/clash.service
|
||||
rm -rf /usr/lib/systemd/system/clash.service
|
||||
rm -rf /www/clash
|
||||
rm -rf /tmp/clash_$USER
|
||||
sed -Ei s/0:7890/7890:7890/g /etc/passwd
|
||||
userdel -r shellclash 2>/dev/null
|
||||
echo -----------------------------------------------
|
||||
|
||||
@@ -16,9 +16,6 @@ linkconfig(){
|
||||
echo " 9 神机规则高级版"
|
||||
echo " 10 神机规则-回国专用"
|
||||
echo " 11 李哥规则-墙洞专用"
|
||||
echo " 12 基础规则-仅Geoip CN+Final"
|
||||
echo " 13 网易云解锁-仅规则分组"
|
||||
echo " 14 ACL4SSR重度全分组+谷歌优化"
|
||||
echo -----------------------------------------------
|
||||
echo 0 返回上级菜单
|
||||
read -p "请输入对应数字 > " num
|
||||
@@ -41,7 +38,7 @@ linkserver(){
|
||||
echo 当前使用后端为:$server_link
|
||||
echo 1 api.dler.io (墙洞提供)
|
||||
echo 2 sub.shellclash.ga (作者提供)
|
||||
echo 3 api.wcc.best (sub_web作者提供)
|
||||
echo 3 sub.xeton.dev (SUB作者T大提供)
|
||||
echo 4 sub.id9.cc (品云提供)
|
||||
echo 5 sub.maoxiongnet.com (猫熊提供)
|
||||
echo -----------------------------------------------
|
||||
@@ -132,6 +129,7 @@ getlink(){
|
||||
echo -----------------------------------------------
|
||||
read -p "请直接输入第${i}个链接或对应数字选项 > " link
|
||||
test=$(echo $link | grep "://")
|
||||
link=`echo ${link/\#*/''}` #删除链接附带的注释内容
|
||||
link=`echo ${link/\ \(*\)/''}` #删除恶心的超链接内容
|
||||
link=`echo ${link/*\&url\=/""}` #将clash完整链接还原成单一链接
|
||||
link=`echo ${link/\&config\=*/""}` #将clash完整链接还原成单一链接
|
||||
@@ -321,8 +319,8 @@ clashlink(){
|
||||
#下载更新相关
|
||||
gettar(){
|
||||
$clashdir/start.sh webget /tmp/clashfm.tar.gz $tarurl
|
||||
[ "$?" = "1" ] && echo "文件下载失败!" && exit 1
|
||||
$clashdir/start.sh stop
|
||||
[ "$?" != "0" ] && echo "文件下载失败,请尝试使用其他安装源!" && exit 1
|
||||
$clashdir/start.sh stop 2>/dev/null
|
||||
#解压
|
||||
echo -----------------------------------------------
|
||||
echo 开始解压文件!
|
||||
@@ -334,8 +332,8 @@ gettar(){
|
||||
#判断系统类型写入不同的启动文件
|
||||
if [ -f /etc/rc.common ];then
|
||||
#设为init.d方式启动
|
||||
mv $clashdir/clashservice /etc/init.d/clash
|
||||
chmod 777 /etc/init.d/clash
|
||||
cp -f $clashdir/clashservice /etc/init.d/clash
|
||||
chmod 755 /etc/init.d/clash
|
||||
else
|
||||
[ -w /etc/systemd/system ] && sysdir=/etc/systemd/system
|
||||
[ -w /usr/lib/systemd/system ] && sysdir=/usr/lib/systemd/system
|
||||
@@ -346,16 +344,16 @@ gettar(){
|
||||
systemctl daemon-reload
|
||||
else
|
||||
#设为保守模式启动
|
||||
sed -i '/start_old=*/'d $clashdir/mark
|
||||
echo start_old=已开启 >> $clashdir/mark
|
||||
setconfig start_old 已开启
|
||||
fi
|
||||
fi
|
||||
#修饰文件及版本号
|
||||
shtype=sh && [ -n "$(ls -l /bin/sh|grep -oE 'dash|show|bash')" ] && shtype=bash
|
||||
sed -i "s|/bin/sh|/bin/$shtype|" $clashdir/start.sh
|
||||
chmod 777 $clashdir/start.sh
|
||||
sed -i '/versionsh_l=*/'d $clashdir/mark
|
||||
echo versionsh_l=$release_new >> $clashdir/mark
|
||||
chmod 755 $clashdir/start.sh
|
||||
setconfig versionsh_l $release_new
|
||||
#设置更新地址
|
||||
[ -n "$url" ] && setconfig update_url $url
|
||||
#设置环境变量
|
||||
[ -w /opt/etc/profile ] && profile=/opt/etc/profile
|
||||
[ -w /jffs/configs/profile.add ] && profile=/jffs/configs/profile.add
|
||||
@@ -371,10 +369,25 @@ gettar(){
|
||||
exit 1
|
||||
fi
|
||||
#华硕/Padavan额外设置
|
||||
[ -n "$systype" ] && sed -i '/ShellClash初始化/'d $initdir && echo "$clashdir/start.sh init #ShellClash初始化脚本" >> $initdir
|
||||
[ -n "$initdir" ] && {
|
||||
sed -i '/ShellClash初始化/'d $initdir && touch $initdir && echo "$clashdir/start.sh init #ShellClash初始化脚本" >> $initdir
|
||||
setconfig initdir $initdir
|
||||
}
|
||||
#小米镜像化OpenWrt额外设置
|
||||
if [ "$systype" = "mi_snapshot" ];then
|
||||
chmod 755 $clashdir/misnap_init.sh
|
||||
uci set firewall.ShellClash=include
|
||||
uci set firewall.ShellClash.type='script'
|
||||
uci set firewall.ShellClash.path='/data/clash/misnap_init.sh'
|
||||
uci set firewall.ShellClash.enabled='1'
|
||||
uci commit firewall
|
||||
setconfig systype $systype
|
||||
else
|
||||
rm -rf $clashdir/misnap_init.sh
|
||||
rm -rf $clashdir/clashservice
|
||||
fi
|
||||
#删除临时文件
|
||||
rm -rf /tmp/clashfm.tar.gz
|
||||
rm -rf $clashdir/clashservice
|
||||
rm -rf $clashdir/clash.service
|
||||
}
|
||||
getsh(){
|
||||
@@ -398,7 +411,7 @@ getsh(){
|
||||
getcpucore(){
|
||||
cputype=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]')
|
||||
[ -n "$(echo $cputype | grep -E "linux.*armv.*")" ] && cpucore="armv5"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*armv7.*")" ] && [ -n "$(cat /proc/cpuinfo | grep vfp)" ] && cpucore="armv7"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*armv7.*")" ] && [ -n "$(cat /proc/cpuinfo | grep vfp)" ] && [ ! -d /jffs/clash ] && cpucore="armv7"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*aarch64.*|linux.*armv8.*")" ] && cpucore="armv8"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*86.*")" ] && cpucore="386"
|
||||
[ -n "$(echo $cputype | grep -E "linux.*86_64.*")" ] && cpucore="amd64"
|
||||
@@ -415,7 +428,7 @@ setcpucore(){
|
||||
echo -e "当前可供在线下载的处理器架构为:"
|
||||
echo $cpucore_list | awk -F " " '{for(i=1;i<=NF;i++) {print i" "$i }}'
|
||||
echo -e "如果您的CPU架构未在以上列表中,请运行【uname -a】命令,并复制好返回信息"
|
||||
echo -e "之后前往 t.me/clashfm 群提交或 github.com/juewuy/ShellClash 提交issue"
|
||||
echo -e "之后前往 t.me/ShellClash 群提交或 github.com/juewuy/ShellClash 提交issue"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
setcpucore=$(echo $cpucore_list | awk '{print $"'"$num"'"}' )
|
||||
@@ -515,18 +528,22 @@ getgeo(){
|
||||
echo -e "\033[32mGeoIP/CN_IP数据库文件下载成功!\033[0m"
|
||||
Geo_v=$GeoIP_v
|
||||
setconfig Geo_v $GeoIP_v
|
||||
setconfig geotype $geotype
|
||||
if [ "$geoname" = "Country.mmdb" ];then
|
||||
geotype=$geotype
|
||||
setconfig geotype $geotype
|
||||
fi
|
||||
fi
|
||||
}
|
||||
setgeo(){
|
||||
echo -----------------------------------------------
|
||||
[ "$geotype" = "Country.mmdb" ] && geo_type=全球版 || geo_type=精简版
|
||||
[ -n "$geo_type" ] && echo -e "当前使用的是\033[47;30m$geo_type数据库\033[0m"
|
||||
[ "$geotype" = "cn_mini.mmdb" ] && echo -e "当前使用的是\033[47;30m精简版数据库\033[0m" || echo -e "当前使用的是\033[47;30m全球版数据库\033[0m"
|
||||
echo -e "\033[36m请选择需要更新/切换的GeoIP/CN_IP数据库:\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 由\033[32malecthw\033[0m提供的全球版GeoIP数据库(约6mb)"
|
||||
echo -e " 2 由\033[32mHackl0us\033[0m提供的精简版CN-IP数据库(约0.2mb)"
|
||||
echo -e " 3 由\033[32m17mon\033[0m提供的CN-IP文件(需启用CN_IP绕过内核功能,约0.2mb)"
|
||||
[ "$clashcore" = "clash.meta" ] && \
|
||||
echo -e " 4 由\033[32mLoyalsoldier\033[0m提供的GeoSite数据库(限Meta内核,约4.5mb)"
|
||||
echo " 0 返回上级菜单"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
@@ -548,6 +565,10 @@ setgeo(){
|
||||
echo -e "\033[31m未开启绕过内核功能,无需更新CN-IP文件!!\033[0m"
|
||||
sleep 1
|
||||
fi
|
||||
elif [ "$num" = '4' ]; then
|
||||
geotype=geosite.dat
|
||||
geoname=geosite.dat
|
||||
getgeo
|
||||
else
|
||||
update
|
||||
fi
|
||||
@@ -590,13 +611,10 @@ getdb(){
|
||||
sed -i "s/127.0.0.1:9090/${host}:${db_port}/g" $dbdir/*.html
|
||||
#sed -i "s/7892/${db_port}/g" $dbdir/app*.js
|
||||
fi
|
||||
#如果clash在运行则重启clash服务
|
||||
[ "$dbdir" != "/www/clash" ] && [ -n "$PID" ] && $clashdir/start.sh restart
|
||||
#写入配置文件
|
||||
setconfig hostdir \'$hostdir\'
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m面板安装成功!\033[0m"
|
||||
echo -e "\033[36m请使用\033[32;4mhttp://$host$hostdir\033[0;36m访问面板\033[0m"
|
||||
rm -rf /tmp/clashdb.tar.gz
|
||||
sleep 1
|
||||
fi
|
||||
@@ -635,8 +653,10 @@ setdb(){
|
||||
echo -e "请选择面板\033[33m安装类型:\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 安装\033[32m官方面板\033[0m(约500kb)"
|
||||
echo -e " 2 安装\033[32mYacd面板\033[0m(约1.1mb)"
|
||||
echo -e " 3 卸载\033[33m本地面板\033[0m"
|
||||
echo -e " 2 安装\033[32mMeta面板\033[0m(约800kb)"
|
||||
echo -e " 3 安装\033[32mYacd面板\033[0m(约1.1mb)"
|
||||
echo -e " 4 安装\033[32mYacd-Meta魔改面板\033[0m(约1.5mb)"
|
||||
echo -e " 5 卸载\033[33m本地面板\033[0m"
|
||||
echo " 0 返回上级菜单"
|
||||
read -p "请输入对应数字 > " num
|
||||
|
||||
@@ -645,10 +665,18 @@ setdb(){
|
||||
dbdir
|
||||
getdb
|
||||
elif [ "$num" = '2' ]; then
|
||||
db_type=yacd
|
||||
db_type=meta_db
|
||||
dbdir
|
||||
getdb
|
||||
elif [ "$num" = '3' ]; then
|
||||
db_type=yacd
|
||||
dbdir
|
||||
getdb
|
||||
elif [ "$num" = '4' ]; then
|
||||
db_type=meta_yacd
|
||||
dbdir
|
||||
getdb
|
||||
elif [ "$num" = '5' ]; then
|
||||
read -p "确认卸载本地面板?(1/0) > " res
|
||||
if [ "$res" = 1 ];then
|
||||
rm -rf /www/clash
|
||||
@@ -685,6 +713,7 @@ getcrt(){
|
||||
}
|
||||
setcrt(){
|
||||
openssldir=$(openssl version -a 2>&1 | grep OPENSSLDIR | awk -F "\"" '{print $2}')
|
||||
[ -z "$openssldir" ] && openssldir=/etc/ssl
|
||||
if [ -n "$openssldir" ];then
|
||||
crtdir="$openssldir/certs/ca-certificates.crt"
|
||||
echo -----------------------------------------------
|
||||
@@ -714,6 +743,7 @@ setserver(){
|
||||
saveserver(){
|
||||
#写入mark文件
|
||||
setconfig update_url \'$update_url\'
|
||||
setconfig release_url \'$release_url\'
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m源地址更新成功!\033[0m"
|
||||
release_new=""
|
||||
@@ -722,29 +752,46 @@ setserver(){
|
||||
echo -e "\033[30;47m切换ShellClash版本及更新源地址\033[0m"
|
||||
echo -e "当前源地址:\033[4;32m$update_url\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 \033[32m正式版\033[0m&Jsdelivr-CDN源(推荐)"
|
||||
echo -e " 2 \033[36m测试版\033[0m&Jsdelivr-CDN源"
|
||||
echo -e " 3 \033[36m测试版\033[0m&Github源(需开启clash服务)"
|
||||
[ -z "$(curl -V 2>/dev/null)" ] && [ -n "$(wget -V 2>&1 | grep BusyBox)" ] && echo -e " 4 \033[33mHttp专用源\033[0m"
|
||||
echo -e " 5 自定义源地址(用于本地源或自建源)"
|
||||
echo -e " 6 \033[31m版本回退\033[0m"
|
||||
echo -e " 1 \033[32m正式版\033[0m&Jsdelivr-CDN源"
|
||||
echo -e " 2 \033[32m正式版\033[0m&fastgit.org源"
|
||||
echo -e " 3 \033[36m公测版\033[0m&Github源(本机clash服务加速)"
|
||||
echo -e " 4 \033[36m公测版\033[0m&ShellClash源"
|
||||
echo -e " 5 \033[36m公测版\033[0m&githubusercontents加速"
|
||||
echo -e " 6 \033[36m公测版\033[0m&fastgit.org源"
|
||||
echo -e " 7 \033[33m内测版\033[0m(请加TG讨论组:\033[4;36mhttps://t.me/ShellClash\033[0m)"
|
||||
echo -e " 8 自定义源地址(用于本地源或自建源)"
|
||||
echo -e " 9 \033[31m版本回退\033[0m"
|
||||
echo -e " 0 返回上级菜单"
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" ]; then
|
||||
errornum
|
||||
elif [ "$num" = 1 ]; then
|
||||
update_url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash'
|
||||
release_url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash'
|
||||
saveserver
|
||||
elif [ "$num" = 2 ]; then
|
||||
update_url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master'
|
||||
release_url='https://raw.fastgit.org/juewuy/ShellClash'
|
||||
saveserver
|
||||
elif [ "$num" = 3 ]; then
|
||||
update_url='https://raw.githubusercontent.com/juewuy/ShellClash/master'
|
||||
release_url=''
|
||||
saveserver
|
||||
elif [ "$num" = 4 ]; then
|
||||
update_url='http://shellclash.ga'
|
||||
update_url='https://gh.shellclash.ga/master'
|
||||
release_url=''
|
||||
saveserver
|
||||
elif [ "$num" = 5 ]; then
|
||||
update_url='https://raw.githubusercontents.com/juewuy/ShellClash/master'
|
||||
release_url=''
|
||||
saveserver
|
||||
elif [ "$num" = 6 ]; then
|
||||
update_url='https://raw.fastgit.org/juewuy/ShellClash/master'
|
||||
release_url=''
|
||||
saveserver
|
||||
elif [ "$num" = 7 ]; then
|
||||
update_url='http://test.shellclash.ga'
|
||||
release_url=''
|
||||
saveserver
|
||||
elif [ "$num" = 8 ]; then
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入个人源路径 > " update_url
|
||||
if [ -z "$update_url" ];then
|
||||
@@ -752,10 +799,11 @@ setserver(){
|
||||
echo -e "\033[31m取消输入,返回上级菜单\033[0m"
|
||||
else
|
||||
saveserver
|
||||
release_url=''
|
||||
fi
|
||||
elif [ "$num" = 6 ]; then
|
||||
elif [ "$num" = 9 ]; then
|
||||
echo -----------------------------------------------
|
||||
$clashdir/start.sh webget /tmp/clashrelease https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master/bin/release_version echooff rediroff 2>/tmp/clashrelease
|
||||
$clashdir/start.sh webget /tmp/clashrelease https://raw.githubusercontents.com/juewuy/ShellClash/master/bin/release_version echooff rediroff 2>/tmp/clashrelease
|
||||
echo -e "\033[31m请选择想要回退至的release版本:\033[0m"
|
||||
cat /tmp/clashrelease | awk '{print " "NR" "$1}'
|
||||
echo -e " 0 返回上级菜单"
|
||||
@@ -764,29 +812,32 @@ setserver(){
|
||||
setserver
|
||||
elif [ $num -le $(cat /tmp/clashrelease | awk 'END{print NR}') 2>/dev/null ]; then
|
||||
release_version=$(cat /tmp/clashrelease | awk '{print $1}' | sed -n "$num"p)
|
||||
update_url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash@$release_version"
|
||||
update_url="https://raw.githubusercontents.com/juewuy/ShellClash/master/$release_version"
|
||||
saveserver
|
||||
release_url=''
|
||||
else
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[31m输入有误,请重新输入!\033[0m"
|
||||
fi
|
||||
|
||||
elif [ "$num" = 9 ]; then
|
||||
update_url='http://192.168.123.90:8080/ShellClash'
|
||||
else
|
||||
errornum
|
||||
fi
|
||||
}
|
||||
checkupdate(){
|
||||
if [ -z "$release_new" ];then
|
||||
if [ "$update_url" = "https://cdn.jsdelivr.net/gh/juewuy/ShellClash" ];then
|
||||
$clashdir/start.sh webget /tmp/clashversion $update_url@master/bin/release_version echoon rediroff 2>/tmp/clashrelease
|
||||
[ "$?" = "0" ] && release_new=$(cat /tmp/clashversion | head -1)
|
||||
update_url=$update_url@$release_new
|
||||
if [ -n "$release_url" ];then
|
||||
[ -n "$(echo $release_url|grep 'jsdelivr')" ] && check_url=$release_url@master || check_url=$release_url/master
|
||||
$clashdir/start.sh webget /tmp/clashversion $check_url/bin/release_version echoon rediroff 2>/tmp/clashversion
|
||||
release_new=$(cat /tmp/clashversion | head -1)
|
||||
[ -n "$(echo $release_url|grep 'jsdelivr')" ] && update_url=$release_url@$release_new || update_url=$release_url/$release_new
|
||||
setconfig update_url \'$update_url\'
|
||||
release_type=正式版
|
||||
else
|
||||
release_type=测试版
|
||||
fi
|
||||
$clashdir/start.sh webget /tmp/clashversion $update_url/bin/version echooff
|
||||
[ "$?" = "0" ] && release_new=$(cat /tmp/clashversion | grep versionsh | awk -F'=' '{ print $2 }')
|
||||
[ -n "$release_new" ] &&source /tmp/clashversion || echo -e "\033[31m检查更新失败!请检查网络连接或切换安装源!\033[0m"
|
||||
[ "$?" = "0" ] && release_new=$(cat /tmp/clashversion | grep -oE 'versionsh=.*' | awk -F'=' '{ print $2 }')
|
||||
[ -n "$release_new" ] && source /tmp/clashversion 2>/dev/null || echo -e "\033[31m检查更新失败!请检查网络连接或切换安装源!\033[0m"
|
||||
rm -rf /tmp/clashversion
|
||||
fi
|
||||
}
|
||||
@@ -798,11 +849,11 @@ update(){
|
||||
[ "$clashcore" = "clashpre" ] && clash_n=$clashpre_v
|
||||
[ "$clashcore" = "clash.net" ] && clash_n=$clashnet_v
|
||||
[ "$clashcore" = "clash.meta" ] && clash_n=$meta_v
|
||||
clash_v=$($bindir/clash -v 2>/dev/null | awk '{print $2}')
|
||||
clash_v=$($bindir/clash -v 2>/dev/null | sed 's/ linux.*//;s/.* //')
|
||||
[ -z "$clash_v" ] && clash_v=$clashv
|
||||
echo -e "\033[30;47m欢迎使用更新功能:\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 更新\033[36m管理脚本 \033[33m$versionsh_l\033[0m > \033[32m$versionsh\033[0m"
|
||||
echo -e " 1 更新\033[36m管理脚本 \033[33m$versionsh_l\033[0m > \033[32m$versionsh$release_type\033[0m"
|
||||
echo -e " 2 切换\033[33mclash核心 \033[33m$clash_v\033[0m > \033[32m$clash_n\033[0m"
|
||||
echo -e " 3 更新\033[32mGeoIP/CN-IP \033[33m$Geo_v\033[0m > \033[32m$GeoIP_v\033[0m"
|
||||
echo -e " 4 安装本地\033[35mDashboard\033[0m面板"
|
||||
@@ -874,7 +925,7 @@ userguide(){
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m是否需要代理UDP流量(主要用于连接外服游戏)? \033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 \033[33m不代理UDP流量\033[0m(推荐)"
|
||||
echo -e " 1 \033[33m不代理UDP流量(推荐)\033[0m"
|
||||
ip tuntap >/dev/null 2>&1 && [ "$?" = 0 ] && \
|
||||
echo -e " 2 \033[32m使用Tun虚拟网卡\033[0m代理UDP流量" || \
|
||||
echo -e " - \033[0m使用Tun模式(你的设备不支持此模式,如为虚拟机运行请调整虚拟网卡设置)\033[0m"
|
||||
@@ -904,8 +955,8 @@ userguide(){
|
||||
echo -e "\033[33m请先选择你的使用环境: \033[0m"
|
||||
echo -e "\033[0m(你之后依然可以在设置中更改各种配置)\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 \033[32m主路由或旁路由\033[0m"
|
||||
echo -e " 2 \033[36mLinux本机代理\033[0m"
|
||||
echo -e " 1 \033[32m路由设备配置局域网透明代理\033[0m"
|
||||
echo -e " 2 \033[36mLinux设备仅配置本机代理\033[0m"
|
||||
[ -f "$ccfg.bak" ] && echo -e " 3 \033[33m还原之前备份的设置\033[0m"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
@@ -974,7 +1025,7 @@ userguide(){
|
||||
[ "$res" = 1 ] && checkupdate && getcrt
|
||||
fi
|
||||
#设置加密DNS
|
||||
$clashdir/start.sh webget /tmp/ssl_test https://www.baidu.com echooff rediron skipceroff
|
||||
$clashdir/start.sh webget /tmp/ssl_test https://doh.pub echooff rediron skipceroff
|
||||
if [ "$?" = "0" ];then
|
||||
dns_nameserver='https://223.5.5.5/dns-query, https://doh.pub/dns-query, tls://dns.rubyfish.cn:853'
|
||||
dns_fallback='https://1.0.0.1/dns-query, https://8.8.4.4/dns-query, https://doh.opendns.com/dns-query'
|
||||
@@ -991,22 +1042,30 @@ userguide(){
|
||||
sethost
|
||||
fi
|
||||
}
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m是否开启公网访问Dashboard面板及socks服务?\033[0m"
|
||||
echo -e "注意当前设备必须有公网IP才能从公网正常访问"
|
||||
echo -e "此功能会增加暴露风险请谨慎使用!"
|
||||
echo -e "vps设备可能还需要额外在服务商后台开启相关端口(默认为7890与9999)"
|
||||
read -p "现在开启?(1/0) > " res
|
||||
if [ "$res" = 1 ];then
|
||||
host=$(curl ip.sb 2>/dev/null | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
|
||||
if [ -z "$host" ];then
|
||||
sethost
|
||||
fi
|
||||
public_support=已开启
|
||||
setconfig host $host
|
||||
setconfig public_support $public_support
|
||||
if type systemd >/dev/null 2>&1 ;then
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m是否开启公网访问Dashboard面板及socks服务?\033[0m"
|
||||
echo -e "注意当前设备必须有公网IP才能从公网正常访问"
|
||||
echo -e "\033[31m此功能会增加暴露风险请谨慎使用!\033[0m"
|
||||
echo -e "vps设备可能还需要额外在服务商后台开启相关端口"
|
||||
read -p "现在开启?(1/0) > " res
|
||||
if [ "$res" = 1 ];then
|
||||
read -p "请先设置面板访问秘钥 > " secret
|
||||
read -p "请先修改Socks服务端口(1-65535) > " mix_port
|
||||
read -p "请先设置Socks服务密码(账号默认为clash) > " sec
|
||||
[ -z "$sec" ] && authentication=clash:$sec
|
||||
host=$(curl ip.sb 2>/dev/null | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
|
||||
if [ -z "$host" ];then
|
||||
sethost
|
||||
fi
|
||||
public_support=已开启
|
||||
setconfig secret $secret
|
||||
setconfig mix_port $mix_port
|
||||
setconfig host $host
|
||||
setconfig public_support $public_support
|
||||
setconfig authentication \'$authentication\'
|
||||
fi
|
||||
fi
|
||||
|
||||
#提示导入订阅或者配置文件
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m是否导入配置文件?\033[0m(这是运行前的最后一步)"
|
||||
@@ -1028,9 +1087,9 @@ testcommand(){
|
||||
echo -e "\033[30;47m这里是测试命令菜单\033[0m"
|
||||
echo -e "\033[33m如遇问题尽量运行相应命令后截图发群\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo " 1 查看clash运行时的报错信息"
|
||||
echo " 1 查看Clash运行时的报错信息(会停止clash服务)"
|
||||
echo " 2 查看系统DNS端口(:53)占用 "
|
||||
echo " 3 测试ssl加密(aes-128-gcm)跑分"
|
||||
echo " 3 测试ssl加密(aes-128-gcm)跑分"
|
||||
echo " 4 查看iptables端口转发详情"
|
||||
echo " 5 查看config.yaml前40行"
|
||||
echo " 6 测试代理服务器连通性(google.tw)"
|
||||
@@ -1102,4 +1161,4 @@ testcommand(){
|
||||
errornum
|
||||
clashsh
|
||||
fi
|
||||
}
|
||||
}
|
||||
23
scripts/misnap_init.sh
Normal file
23
scripts/misnap_init.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
clashdir=/data/clash
|
||||
profile=/etc/profile
|
||||
|
||||
#h初始化环境变量
|
||||
echo "alias clash=\"$clashdir/clash.sh\"" >> $profile
|
||||
echo "export clashdir=\"$clashdir\"" >> $profile
|
||||
|
||||
#设置init.d服务并启动clash服务
|
||||
ln -sf $clashdir/clashservice /etc/init.d/clash
|
||||
chmod 755 /etc/init.d/clash
|
||||
|
||||
if [ ! -f $clashdir/.dis_startup ];then
|
||||
log_file=`uci get system.@system[0].log_file`
|
||||
while [ "$i" -lt 10 ];do
|
||||
sleep 3
|
||||
[ -n "$(grep 'init complete' $log_file)" ] && i=10 || i=$((i+1))
|
||||
done
|
||||
/etc/init.d/clash start
|
||||
/etc/init.d/clash enable
|
||||
fi
|
||||
450
scripts/start.sh
450
scripts/start.sh
@@ -13,34 +13,21 @@ getconfig(){
|
||||
#默认设置
|
||||
[ -z "$bindir" ] && bindir=$clashdir
|
||||
[ -z "$redir_mod" ] && [ "$USER" = "root" -o "$USER" = "admin" ] && redir_mod=Redir模式
|
||||
[ -z "$redir_mod" ] && redir_mod=Redir模式
|
||||
[ -z "$redir_mod" ] && redir_mod=纯净模式
|
||||
[ -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 "$ipv6_dns" ] && ipv6_dns=$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_redir" ] && dns_redir=未开启
|
||||
[ -z "$cn_ip_route" ] && cn_ip_route=未开启
|
||||
[ -z "$public_support" ] && public_support=未开启
|
||||
[ -z "$stearming_int" ] && stearming_int=24
|
||||
[ -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='22,53,587,465,995,993,143,80,443,8080'
|
||||
#获取本机host地址
|
||||
[ -z "$host" ] && 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 '\ 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
|
||||
[ -z "$host" ] && host=127.0.0.1
|
||||
[ -z "$streaming_int" ] && streaming_int=24
|
||||
#是否代理常用端口
|
||||
[ -z "$common_ports" ] && common_ports=已开启
|
||||
[ -z "$multiport" ] && multiport='22,53,587,465,995,993,143,80,443,8080'
|
||||
[ "$common_ports" = "已开启" ] && ports="-m multiport --dports $multiport"
|
||||
}
|
||||
}
|
||||
setconfig(){
|
||||
#参数1代表变量名,参数2代表变量值,参数3即文件路径
|
||||
[ -z "$3" ] && configpath=$clashdir/mark || configpath=$3
|
||||
@@ -49,7 +36,7 @@ setconfig(){
|
||||
compare(){
|
||||
if [ ! -f $1 -o ! -f $2 ];then
|
||||
return 1
|
||||
elif command -v cmp >/dev/null 2>&1;then
|
||||
elif type cmp >/dev/null 2>&1;then
|
||||
cmp -s $1 $2
|
||||
else
|
||||
[ "$(cat $1)" = "$(cat $2)" ] && return 0 || return 1
|
||||
@@ -88,6 +75,61 @@ mark_time(){
|
||||
sed -i '/start_time*/'d $clashdir/mark
|
||||
echo start_time=$start_time >> $clashdir/mark
|
||||
}
|
||||
streaming(){
|
||||
getconfig
|
||||
#设置循环检测clashDNS端口
|
||||
ns_type=$(nslookup -version 2>&1 | grep -io busybox)
|
||||
ns_lookup(){
|
||||
[ -n "$ns_type" ] && \
|
||||
nslookup $1 127.0.0.1:${dns_port} > /dev/null 2>&1 || \
|
||||
nslookup -port=${dns_port} $1 127.0.0.1 > /dev/null 2>&1
|
||||
}
|
||||
while [ "$i" != 0 ];do
|
||||
[ "$j" = 60 ] && exit 1
|
||||
sleep 1
|
||||
ns_lookup baidu.com
|
||||
i=$?
|
||||
j=$((j+1))
|
||||
done
|
||||
streaming_dns(){
|
||||
streaming_dir=$clashdir/streaming/${streaming_type}_Domains.list
|
||||
rm -rf $clashdir/steaming
|
||||
if [ ! -s "$streaming_dir" ];then
|
||||
echo 未找到$streaming_type域名数据库,正在下载!
|
||||
mkdir -p $clashdir/streaming
|
||||
$0 webget "$streaming_dir" "$update_url/bin/${streaming_type}_Domains.list"
|
||||
[ "$?" = "1" ] && logger "$streaming_type数据库文件下载失败"
|
||||
fi
|
||||
if [ -f "$streaming_dir" ];then
|
||||
for line in $(cat $streaming_dir);do
|
||||
[ -n "$line" ] && ns_lookup "$line"
|
||||
done >/dev/null 2>&1
|
||||
echo "$streaming_type域名预解析完成!"
|
||||
fi
|
||||
}
|
||||
echo "正在后台进行流媒体预解析服务,请耐心等待!"
|
||||
[ "$netflix_pre" = "已开启" ] && streaming_type=Netflix && streaming_dns
|
||||
[ "$disneyP_pre" = "已开启" ] && streaming_type=Disney_Plus && streaming_dns
|
||||
echo "请输入回车以继续!"
|
||||
}
|
||||
autoSSH(){
|
||||
#自动开启SSH
|
||||
[ "$(nvram get ssh_en)" = 0 ] && nvram set ssh_en=1 && nvram commit
|
||||
[ "`uci -c /usr/share/xiaoqiang get xiaoqiang_version.version.CHANNEL`" != 'stable' ] && {
|
||||
uci -c /usr/share/xiaoqiang set xiaoqiang_version.version.CHANNEL='stable'
|
||||
uci -c /usr/share/xiaoqiang commit xiaoqiang_version.version
|
||||
}
|
||||
[ -z "$(pidof dropbear)" -o -z "$(netstat -ntul | grep :22)" ] && {
|
||||
sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear
|
||||
/etc/init.d/dropbear restart
|
||||
[ -n "$mi_autoSSH_pwd" ] && echo -e "$mi_autoSSH_pwd\n$mi_autoSSH_pwd" | passwd root
|
||||
}
|
||||
#备份还原SSH秘钥
|
||||
[ -f $clashdir/dropbear_rsa_host_key ] && ln -sf $clashdir/dropbear_rsa_host_key /etc/dropbear/dropbear_rsa_host_key
|
||||
}
|
||||
host_lan(){
|
||||
[ -n "$(echo $host | grep -oE "([0-9]{1,3}[\.]){3}[0-9]{1,3}" )" ] && host_lan="$(echo $host | grep -oE "([0-9]{1,3}[\.]){3}")0/24"
|
||||
}
|
||||
#配置文件相关
|
||||
getyaml(){
|
||||
[ -z "$rule_link" ] && rule_link=1
|
||||
@@ -95,8 +137,8 @@ getyaml(){
|
||||
#前后端订阅服务器地址索引,可在此处添加!
|
||||
Server=`sed -n ""$server_link"p"<<EOF
|
||||
https://api.dler.io
|
||||
http://sub.shellclash.ga
|
||||
https://api.wcc.best
|
||||
https://sub.shellclash.ga
|
||||
https://sub.xeton.dev
|
||||
https://sub.id9.cc
|
||||
https://sub.maoxiongnet.com
|
||||
EOF`
|
||||
@@ -122,9 +164,9 @@ EOF`
|
||||
Https=$(echo ${Https//\%26/\&}) #将%26替换回&
|
||||
#如果传来的是Url链接则合成Https链接,否则直接使用Https链接
|
||||
if [ -z "$Https" ];then
|
||||
[ -n "$(echo $Url | grep -o 'vless')" ] && Server='http://sub.shellclash.ga'
|
||||
[ -n "$(echo $Url | grep -o 'vless')" ] && Server='https://sub.shellclash.ga'
|
||||
Https="$Server/sub?target=clash&insert=true&new_name=true&scv=true&udp=true&exclude=$exclude&include=$include&url=$Url&config=$Config"
|
||||
markhttp=1
|
||||
url_type=true
|
||||
fi
|
||||
#输出
|
||||
echo -----------------------------------------------
|
||||
@@ -137,7 +179,7 @@ EOF`
|
||||
rm -rf $yamlnew
|
||||
$0 webget $yamlnew $Https
|
||||
if [ "$?" = "1" ];then
|
||||
if [ -z "$markhttp" ];then
|
||||
if [ -z "$url_type" ];then
|
||||
echo -----------------------------------------------
|
||||
logger "配置文件获取失败!" 31
|
||||
echo -e "\033[31m请尝试使用【在线生成配置文件】功能!\033[0m"
|
||||
@@ -206,6 +248,15 @@ EOF`
|
||||
setconfig clashcore clash.net
|
||||
echo -----------------------------------------------
|
||||
fi
|
||||
#检测并去除无效节点组
|
||||
[ -n "$url_type" ] && type xargs >/dev/null 2>&1 && {
|
||||
cat $yamlnew | grep -A 8 "\-\ name:" | xargs | sed 's/- name: /\n/g' | sed 's/ type: .*proxies: /#/g' | sed 's/ rules:.*//g' | sed 's/- //g' | grep -E '#DIRECT $' | awk -F '#' '{print $1}' > /tmp/clash_proxies_$USER
|
||||
while read line ;do
|
||||
sed -i "/- $line/d" $yamlnew
|
||||
sed -i "/- name: $line/,/- DIRECT/d" $yamlnew
|
||||
done < /tmp/clash_proxies_$USER
|
||||
rm -rf /tmp/clash_proxies_$USER
|
||||
}
|
||||
#使用核心内置test功能检测
|
||||
if [ -x $bindir/clash ];then
|
||||
$bindir/clash -t -d $bindir -f $yamlnew >/dev/null
|
||||
@@ -224,12 +275,16 @@ EOF`
|
||||
mv -f $yamlnew $yaml
|
||||
fi
|
||||
echo -e "\033[32m已成功获取配置文件!\033[0m"
|
||||
rm -rf $yamlnew
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
modify_yaml(){
|
||||
##########需要变更的配置###########
|
||||
[ -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 "$skip_cert" ] && skip_cert=已开启
|
||||
#默认fake-ip过滤列表
|
||||
fake_ft_df='"*.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","*.sgcc.com.cn","*.alicdn.com","*.aliyuncs.com"'
|
||||
lan='allow-lan: true'
|
||||
#mode='mode: Rule'
|
||||
log='log-level: info'
|
||||
@@ -238,19 +293,29 @@ modify_yaml(){
|
||||
external="external-controller: 0.0.0.0:$db_port"
|
||||
[ -d $clashdir/ui ] && db_ui=ui
|
||||
if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ];then
|
||||
[ "$clashcore" = "clash.meta" ] && stack=gvisor || stack=system
|
||||
tun="tun: {enable: true, stack: $stack}"
|
||||
[ "$clashcore" = 'clash.meta' ] && tun_meta=', device: utun, auto-route: false'
|
||||
tun="tun: {enable: true, stack: system$tun_meta}"
|
||||
else
|
||||
tun='tun: {enable: false}'
|
||||
fi
|
||||
exper='experimental: {ignore-resolve-fail: true, interface-name: en0}'
|
||||
#dns配置
|
||||
dns_default='114.114.114.114, 223.5.5.5'
|
||||
[ "$clashcore" = 'clash.meta' ] && dns_default_meta=', https://1.0.0.1/dns-query, https://223.5.5.5/dns-query'
|
||||
dns_default="114.114.114.114, 223.5.5.5$dns_default_meta"
|
||||
if [ -f $clashdir/fake_ip_filter ];then
|
||||
while read line;do
|
||||
fake_ft_ad=$fake_ft_ad,\"$line\"
|
||||
done < $clashdir/fake_ip_filter
|
||||
fi
|
||||
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","*.sgcc.com.cn","*.alicdn.com","*.aliyuncs.com"], default-nameserver: ['$dns_default', 127.0.0.1:53], nameserver: ['$dns_nameserver', 127.0.0.1:53], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}'
|
||||
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: ['${fake_ft_df}${fake_ft_ad}'], default-nameserver: ['$dns_default', 127.0.0.1:53], nameserver: ['$dns_nameserver', 127.0.0.1:53], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}'
|
||||
else
|
||||
dns='dns: {enable: true, '$dns_v6', listen: 0.0.0.0:'$dns_port', use-hosts: true, enhanced-mode: redir-host, default-nameserver: ['$dns_default', 127.0.0.1:53], nameserver: ['$dns_nameserver$dns_local'], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}'
|
||||
fi
|
||||
#meta专属功能
|
||||
if [ "$clashcore" = "clash.meta" -a "$sniffer" = "已启用" ];then
|
||||
sniffer_set="sniffer: {enable: true, force: false, sniffing: [tls]}"
|
||||
fi
|
||||
#设置目录
|
||||
yaml=$clashdir/config.yaml
|
||||
tmpdir=/tmp/clash_$USER
|
||||
@@ -262,11 +327,9 @@ modify_yaml(){
|
||||
b=$(grep -n "^prox" $yaml | head -1 | cut -d ":" -f 1)
|
||||
b=$((b-1))
|
||||
mkdir -p $tmpdir > /dev/null
|
||||
[ "$b" != "0" ] && sed "${a},${b}d" $yaml > $tmpdir/proxy.yaml
|
||||
[ "$b" -gt 0 ] && sed "${a},${b}d" $yaml > $tmpdir/proxy.yaml || cp -f $yaml $tmpdir/proxy.yaml
|
||||
#跳过本地tls证书验证
|
||||
[ "$skip_cert" = "已开启" ] && sed -i '1,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/proxy.yaml
|
||||
#检测是否使用script规则
|
||||
[ -n "$(cat $yaml | grep -E '^script:')" ] && mode='mode: Script'
|
||||
#添加配置
|
||||
###################################
|
||||
cat > $tmpdir/set.yaml <<EOF
|
||||
@@ -283,19 +346,34 @@ secret: $secret
|
||||
$tun
|
||||
$exper
|
||||
$dns
|
||||
$sniffer_set
|
||||
store-selected: $restore
|
||||
hosts:
|
||||
EOF
|
||||
###################################
|
||||
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml
|
||||
#读取本机hosts并生成配置文件
|
||||
hosts_dir=/etc/hosts
|
||||
if [ "$redir_mod" != "纯净模式" ] && [ "$dns_no" != "已禁用" ] && [ -f $hosts_dir ];then
|
||||
while read line;do
|
||||
[ -n "$(echo "$line")" ] && \
|
||||
[ -z "$(echo "$line" | grep '#')" ] && \
|
||||
hosts_ip=$(echo $line | awk '{print $1}') && \
|
||||
hosts_domain=$(echo $line | awk '{print $2}') && \
|
||||
echo " '$hosts_domain': $hosts_ip" >> $tmpdir/hosts.yaml
|
||||
done < $hosts_dir
|
||||
fi
|
||||
#合并文件
|
||||
cut -c 1- $tmpdir/set.yaml $yaml_user $tmpdir/proxy.yaml > $tmpdir/config.yaml
|
||||
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml
|
||||
[ -f $tmpdir/hosts.yaml ] && yaml_hosts=$tmpdir/hosts.yaml
|
||||
cut -c 1- $tmpdir/set.yaml $yaml_hosts $yaml_user $tmpdir/proxy.yaml > $tmpdir/config.yaml
|
||||
#插入自定义规则
|
||||
sed -i "/#自定义规则/d" $tmpdir/config.yaml
|
||||
space=$(sed -n '/^rules/{n;p}' $tmpdir/proxy.yaml | grep -oE '^\ *') #获取空格数
|
||||
if [ -f $clashdir/rules.yaml ];then
|
||||
sed -i '/^$/d' $clashdir/rules.yaml && echo >> $clashdir/rules.yaml #处理换行
|
||||
while read line;do
|
||||
[ -z "$(echo "$line " | grep '#')" ] && \
|
||||
[ -z "$(echo "$line" | grep '#')" ] && \
|
||||
[ -n "$(echo "$line" | grep '\-\ ')" ] && \
|
||||
line=$(echo "$line" | sed 's#/#\\/#') && \
|
||||
sed -i "/^rules:/a\\$space$line #自定义规则" $tmpdir/config.yaml
|
||||
@@ -312,6 +390,7 @@ EOF
|
||||
fi
|
||||
rm -f $tmpdir/set.yaml
|
||||
rm -f $tmpdir/proxy.yaml
|
||||
rm -f $tmpdir/hosts.yaml
|
||||
}
|
||||
#设置路由规则
|
||||
cn_ip_route(){
|
||||
@@ -333,44 +412,44 @@ cn_ip_route(){
|
||||
fi
|
||||
}
|
||||
start_redir(){
|
||||
#允许tun网卡接受流量
|
||||
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
|
||||
#获取局域网host地址
|
||||
host_lan
|
||||
#流量过滤规则
|
||||
iptables -t nat -N clash
|
||||
iptables -t nat -A clash -d 0.0.0.0/8 -j RETURN
|
||||
iptables -t nat -A clash -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t nat -A clash -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t nat -A clash -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t nat -A clash -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t nat -A clash -d 172.16.0.0/12 -j RETURN
|
||||
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
|
||||
[ -n "$host_lan" ] && iptables -t nat -A clash -d $host_lan -j RETURN
|
||||
[ "$dns_mod" = "redir_host" -a "$cn_ip_route" = "已开启" ] && iptables -t nat -A clash -m set --match-set cn_ip dst -j RETURN >/dev/null 2>&1 #绕过大陆IP
|
||||
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
|
||||
iptables -t nat -A clash -p tcp -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
|
||||
iptables -t nat -A clash -p tcp -s 192.168.0.0/16 -j REDIRECT --to-ports $redir_port
|
||||
iptables -t nat -A clash -p tcp -s 10.0.0.0/8 -j REDIRECT --to-ports $redir_port
|
||||
[ -n "$host_lan" ] && iptables -t nat -A clash -p tcp -s $host_lan -j REDIRECT --to-ports $redir_port
|
||||
fi
|
||||
iptables -t nat -A PREROUTING -p tcp -j clash
|
||||
if [ "$public_support" = "已开启" ];then
|
||||
iptables -I INPUT -p tcp --dport $mix_port -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport $db_port -j ACCEPT
|
||||
fi
|
||||
#Google home DNS特殊处理
|
||||
iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j clash
|
||||
iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j clash
|
||||
#将PREROUTING链指向clash链
|
||||
iptables -t nat -A PREROUTING -p tcp $ports -j clash
|
||||
#Docker特殊处理
|
||||
[ "$local_proxy" = "已开启" ] && iptables -t nat -I PREROUTING -s 172.16.0.0/12 -j clash
|
||||
#禁用QUIC
|
||||
if [ "$quic_rj" = 已启用 ] && [ "$tproxy_mod" = "已开启" ];then
|
||||
[ "$dns_mod" = "redir_host" -a "$cn_ip_route" = "已开启" ] && set_cn_ip='-m set ! --match-set cn_ip dst'
|
||||
iptables -I INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1
|
||||
fi
|
||||
#设置ipv6转发
|
||||
ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')
|
||||
if [ -n "$ip6_nat" -a "$ipv6_support" = "已开启" ];then
|
||||
@@ -391,23 +470,26 @@ start_redir(){
|
||||
fi
|
||||
}
|
||||
start_dns(){
|
||||
#屏蔽OpenWrt内置53端口转发
|
||||
iptables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null
|
||||
iptables -t nat -D PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null
|
||||
ip6tables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null
|
||||
ip6tables -t nat -D PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null
|
||||
#设置dns转发
|
||||
iptables -t nat -N clash_dns
|
||||
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
|
||||
iptables -t nat -A clash_dns -p udp -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
|
||||
iptables -t nat -A clash_dns -p udp -j REDIRECT --to $dns_port
|
||||
fi
|
||||
iptables -t nat -A PREROUTING -p udp -j clash_dns
|
||||
iptables -t nat -I PREROUTING -p udp --dport 53 -j clash_dns
|
||||
#ipv6DNS
|
||||
ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')
|
||||
if [ -n "$ip6_nat" ];then
|
||||
@@ -415,35 +497,38 @@ start_dns(){
|
||||
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
|
||||
ip6tables -t nat -A clashv6_dns -p udp -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
|
||||
ip6tables -t nat -A clashv6_dns -p udp -j REDIRECT --to $dns_port
|
||||
fi
|
||||
ip6tables -t nat -A PREROUTING -p udp -j clashv6_dns
|
||||
ip6tables -t nat -I PREROUTING -p udp --dport 53 -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(){
|
||||
#获取局域网host地址
|
||||
host_lan
|
||||
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 -p udp --dport 53 -j RETURN
|
||||
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 100.64.0.0/10 -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
|
||||
[ -n "$host_lan" ] && iptables -t mangle -A clash -d $host_lan -j RETURN
|
||||
[ "$dns_mod" = "redir_host" -a "$cn_ip_route" = "已开启" ] && iptables -t mangle -A clash -m set --match-set cn_ip dst -j RETURN >/dev/null 2>&1 #绕过大陆IP
|
||||
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
|
||||
#mac白名单
|
||||
@@ -455,7 +540,9 @@ start_udp(){
|
||||
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
|
||||
iptables -t mangle -A clash -p udp -s 192.168.0.0/16 -j TPROXY --on-port $redir_port --tproxy-mark 1
|
||||
iptables -t mangle -A clash -p udp -s 10.0.0.0/8 -j TPROXY --on-port $redir_port --tproxy-mark 1
|
||||
[ -n "$host_lan" ] && iptables -t mangle -A clash -p udp -s $host_lan -j TPROXY --on-port $redir_port --tproxy-mark 1
|
||||
fi
|
||||
iptables -t mangle -A PREROUTING -p udp -j clash
|
||||
}
|
||||
@@ -463,77 +550,96 @@ start_output(){
|
||||
#流量过滤规则
|
||||
iptables -t nat -N clash_out
|
||||
iptables -t nat -A clash_out -m owner --gid-owner 7890 -j RETURN
|
||||
iptables -t nat -A clash_out -d 0.0.0.0/8 -j RETURN
|
||||
iptables -t nat -A clash_out -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t nat -A clash_out -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t nat -A clash_out -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t nat -A clash_out -d 172.16.0.0/12 -j RETURN
|
||||
iptables -t nat -A clash_out -d 192.168.0.0/16 -j RETURN
|
||||
iptables -t nat -A clash_out -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t nat -A clash_out -d 240.0.0.0/4 -j RETURN
|
||||
[ "$dns_mod" = "redir_host" -a "$cn_ip_route" = "已开启" ] && iptables -t nat -A clash_out -m set --match-set cn_ip dst -j RETURN >/dev/null 2>&1 #绕过大陆IP
|
||||
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
|
||||
#mac白名单
|
||||
for mac in $(cat $clashdir/mac); do
|
||||
iptables -t nat -A clash_out -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_out -m mac --mac-source $mac -j RETURN
|
||||
done
|
||||
iptables -t nat -A clash_out -p tcp $ports -j REDIRECT --to-ports $redir_port
|
||||
fi
|
||||
iptables -t nat -A OUTPUT -p tcp -j clash_out
|
||||
iptables -t nat -A clash_out -p tcp -j REDIRECT --to-ports $redir_port
|
||||
iptables -t nat -A OUTPUT -p tcp -s 127.0.0.0/8 -j clash_out
|
||||
iptables -t nat -A OUTPUT -p tcp -s 172.16.0.0/12 -j clash_out
|
||||
iptables -t nat -A OUTPUT -p tcp -d 198.18.0.0/16 -j clash_out
|
||||
#设置dns转发
|
||||
iptables -t nat -N clash_dns_out
|
||||
iptables -t nat -A clash_dns_out -m owner --gid-owner 7890 -j RETURN
|
||||
if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then
|
||||
#mac白名单
|
||||
for mac in $(cat $clashdir/mac); do
|
||||
iptables -t nat -A clash_dns_out -p udp --dport 53 -m mac --mac-source $mac -j REDIRECT --to $dns_port
|
||||
iptables -t nat -A clash_dns_out -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_out -m mac --mac-source $mac -j RETURN
|
||||
done
|
||||
iptables -t nat -A clash_dns_out -p udp --dport 53 -j REDIRECT --to $dns_port
|
||||
iptables -t nat -A clash_dns_out -p tcp --dport 53 -j REDIRECT --to $dns_port
|
||||
iptables -t nat -A clash_dns_out -p udp -j REDIRECT --to $dns_port
|
||||
iptables -t nat -A OUTPUT -p udp --dport 53 -s 127.0.0.0/8 -j clash_dns_out
|
||||
iptables -t nat -A OUTPUT -p udp --dport 53 -s 172.16.0.0/12 -j clash_dns_out
|
||||
}
|
||||
start_tun(){
|
||||
if [ "$quic_rj" = 已启用 ];then
|
||||
[ "$dns_mod" = "redir_host" -a "$cn_ip_route" = "已开启" ] && set_cn_ip='-m set ! --match-set cn_ip dst'
|
||||
iptables -I FORWARD -p udp --dport 443 -o utun -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1
|
||||
fi
|
||||
iptables -A FORWARD -o utun -j ACCEPT
|
||||
#ip6tables -A FORWARD -o utun -j ACCEPT > /dev/null 2>&1
|
||||
}
|
||||
start_wan(){
|
||||
[ "$mix_port" = "7890" -o -z "$authentication" ] && {
|
||||
iptables -A INPUT -p tcp -s 10.0.0.0/8 --dport $mix_port -j ACCEPT
|
||||
iptables -A INPUT -p tcp -s 127.0.0.0/8 --dport $mix_port -j ACCEPT
|
||||
iptables -A INPUT -p tcp -s 192.168.0.0/16 --dport $mix_port -j ACCEPT
|
||||
iptables -A INPUT -p tcp -s 172.16.0.0/12 --dport $mix_port -j ACCEPT
|
||||
iptables -A INPUT -p tcp --dport $mix_port -j REJECT
|
||||
type ip6tables >/dev/null 2>&1 && ip6tables -A INPUT -p tcp --dport $mix_port -j REJECT 2> /dev/null
|
||||
}
|
||||
if [ "$public_support" = "已开启" ];then
|
||||
[ "$mix_port" != "7890" -a -n "$authentication" ] && {
|
||||
iptables -I INPUT -p tcp --dport $mix_port -j ACCEPT
|
||||
type ip6tables >/dev/null 2>&1 && ip6tables -I INPUT -p tcp --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
}
|
||||
iptables -I INPUT -p tcp --dport $db_port -j ACCEPT
|
||||
type ip6tables >/dev/null 2>&1 && ip6tables -I INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null
|
||||
fi
|
||||
iptables -t nat -A OUTPUT -p udp -j clash_dns_out
|
||||
}
|
||||
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 tcp $ports -j clash 2> /dev/null
|
||||
iptables -D INPUT -p tcp --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
iptables -D INPUT -p tcp --dport $db_port -j ACCEPT 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 2> /dev/null
|
||||
iptables -t nat -D PREROUTING -p tcp -d 8.8.4.4 -j clash 2> /dev/null
|
||||
iptables -t nat -D PREROUTING -p udp --dport 53 -j clash_dns 2> /dev/null
|
||||
iptables -t nat -D PREROUTING -s 172.16.0.0/12 -j clash 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
|
||||
#重置屏蔽QUIC规则
|
||||
[ "$dns_mod" = "redir_host" -a "$cn_ip_route" = "已开启" ] && set_cn_ip='-m set ! --match-set cn_ip dst'
|
||||
iptables -D INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1
|
||||
iptables -D FORWARD -p udp --dport 443 -o utun -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1
|
||||
#重置output规则
|
||||
iptables -t nat -D OUTPUT -p tcp -j clash_out 2> /dev/null
|
||||
iptables -t nat -D OUTPUT -p tcp -s 127.0.0.0/8 -j clash_out 2> /dev/null
|
||||
iptables -t nat -D OUTPUT -p tcp -s 172.16.0.0/12 -j clash_out 2> /dev/null
|
||||
iptables -t nat -D OUTPUT -p tcp -d 198.18.0.0/16 -j clash_out 2> /dev/null
|
||||
iptables -t nat -F clash_out 2> /dev/null
|
||||
iptables -t nat -X clash_out 2> /dev/null
|
||||
iptables -t nat -D OUTPUT -p udp -j clash_dns_out 2> /dev/null
|
||||
iptables -t nat -D OUTPUT -p udp --dport 53 -s 127.0.0.0/8 -j clash_dns_out 2> /dev/null
|
||||
iptables -t nat -D OUTPUT -p udp --dport 53 -s 172.16.0.0/12 -j clash_dns_out 2> /dev/null
|
||||
iptables -t nat -F clash_dns_out 2> /dev/null
|
||||
iptables -t nat -X clash_dns_out 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
|
||||
iptables -D INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" -j REJECT >/dev/null 2>&1
|
||||
iptables -D INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" -m set ! --match-set cn_ip dst -j REJECT >/dev/null 2>&1
|
||||
#重置公网访问规则
|
||||
iptables -D INPUT -p tcp -s 10.0.0.0/8 --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
iptables -D INPUT -p tcp -s 127.0.0.0/8 --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
iptables -D INPUT -p tcp -s 172.16.0.0/12 --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
iptables -D INPUT -p tcp -s 192.168.0.0/16 --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
iptables -D INPUT -p tcp --dport $mix_port -j REJECT 2> /dev/null
|
||||
ip6tables -D INPUT -p tcp --dport $mix_port -j REJECT 2> /dev/null
|
||||
iptables -D INPUT -p tcp --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
ip6tables -D INPUT -p tcp --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
iptables -D INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null
|
||||
ip6tables -D INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null
|
||||
#重置ipv6规则
|
||||
ip6tables -D INPUT -p tcp --dport $mix_port -j ACCEPT 2> /dev/null
|
||||
ip6tables -D INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null
|
||||
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 -D PREROUTING -p udp --dport 53 -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
|
||||
@@ -542,9 +648,11 @@ stop_iptables(){
|
||||
#清理ipset规则
|
||||
ipset destroy cn_ip >/dev/null 2>&1
|
||||
#移除dnsmasq转发规则
|
||||
uci del dhcp.@dnsmasq[-1].server >/dev/null 2>&1
|
||||
uci delete dhcp.@dnsmasq[0].cachesize >/dev/null 2>&1
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
[ "$dns_redir" = "已开启" ] && {
|
||||
uci del dhcp.@dnsmasq[-1].server >/dev/null 2>&1
|
||||
uci delete dhcp.@dnsmasq[0].cachesize >/dev/null 2>&1
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
}
|
||||
}
|
||||
#面板配置保存相关
|
||||
web_save(){
|
||||
@@ -559,8 +667,8 @@ web_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
|
||||
now=$(echo $line | grep -oE '"now".*",' | sed 's/"now"://g' | sed 's/"type":.*//g' | sed 's/,//g')
|
||||
[ "$def" != "$now" ] && echo $line | grep -oE '"name".*"now".*",' | sed 's/"name"://g' | sed 's/"now"://g' | sed 's/"type":.*//g' | sed 's/"//g' >> /tmp/clash_web_save_$USER
|
||||
done < /tmp/clash_web_check_$USER
|
||||
rm -rf /tmp/clash_web_check_$USER
|
||||
#对比文件,如果有变动且不为空则写入磁盘,否则清除缓存
|
||||
@@ -579,27 +687,33 @@ web_restore(){
|
||||
}
|
||||
#设置循环检测clash面板端口
|
||||
i=1
|
||||
while [ $i -lt 10 ];do
|
||||
while [ -z "$test" -a "$i" -lt 60 ];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
|
||||
i=$((i+1))
|
||||
done
|
||||
#发送数据
|
||||
num=$(cat $clashdir/web_save | wc -l)
|
||||
for i in `seq $num`;
|
||||
do
|
||||
i=1
|
||||
while [ "$i" -le "$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}\"}"
|
||||
i=$((i+1))
|
||||
done
|
||||
}
|
||||
#启动相关
|
||||
catpac(){
|
||||
#获取本机host地址
|
||||
[ -n "$host" ] && host_pac=$host
|
||||
[ -z "$host_pac" ] && host_pac=$(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_pac" ] && host_pac=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '\ 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
|
||||
cat > /tmp/clash_pac <<EOF
|
||||
//如看见此处内容,请重新安装本地面板!
|
||||
function FindProxyForURL(url, host) {
|
||||
if (
|
||||
isInNet(host, "0.0.0.0", "255.0.0.0")||
|
||||
@@ -613,7 +727,7 @@ function FindProxyForURL(url, host) {
|
||||
)
|
||||
return "DIRECT";
|
||||
else
|
||||
return "PROXY $host:$mix_port; DIRECT; SOCKS5 $host:$mix_port"
|
||||
return "PROXY $host_pac:$mix_port; DIRECT; SOCKS5 $host_pac:$mix_port"
|
||||
}
|
||||
EOF
|
||||
compare /tmp/clash_pac $bindir/ui/pac
|
||||
@@ -623,22 +737,26 @@ bfstart(){
|
||||
#读取配置文件
|
||||
getconfig
|
||||
[ ! -d $bindir/ui ] && mkdir -p $bindir/ui
|
||||
[ -z "$update_url" ] || [ -n "$(echo $update_url | grep 'github')" ] && update_url=https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master
|
||||
update_url=https://ghproxy.com/https://raw.githubusercontent.com/juewuy/ShellClash/master
|
||||
#检查clash核心
|
||||
$bindir/clash -v >/dev/null 2>&1
|
||||
[ "$?" != 0 ] && rm -rf $bindir/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=clash.net || clashcore=clash
|
||||
[ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ] && clashcore=clashpre || clashcore=clash
|
||||
fi
|
||||
[ -z "$cpucore" ] && source $clashdir/getdate.sh && getcpucore
|
||||
[ -z "$cpucore" ] && logger 找不到设备的CPU信息,请手动指定处理器架构类型! 31 && setcpucore
|
||||
$0 webget $bindir/clash "$update_url/bin/$clashcore/clash-linux-$cpucore"
|
||||
[ "$?" = "1" ] && rm -rf $bindir/clash && logger "核心下载失败,已退出!" 31 && exit 1
|
||||
[ ! -x $bindir/clash ] && chmod +x $bindir/clash #检测可执行权限
|
||||
clashv=$($bindir/clash -v | awk '{print $2}')
|
||||
[ ! -x $bindir/clash ] && chmod +x $bindir/clash #检测可执行权限1
|
||||
clashv=$($bindir/clash -v 2>/dev/null | sed 's/ linux.*//;s/.* //')
|
||||
[ -z "$clashv" ] && rm -rf $bindir/clash && logger "核心下载失败,请重新运行或更换安装源!" 31 && exit 1
|
||||
setconfig clashcore $clashcore
|
||||
setconfig clashv $clashv
|
||||
fi
|
||||
fi
|
||||
@@ -648,22 +766,12 @@ bfstart(){
|
||||
mv $clashdir/Country.mmdb $bindir/Country.mmdb
|
||||
else
|
||||
logger "未找到GeoIP数据库,正在下载!" 33
|
||||
[ -z "$geotype" ] && geotype=cn_mini.mmdb
|
||||
$0 webget $bindir/Country.mmdb $update_url/bin/$geotype
|
||||
$0 webget $bindir/Country.mmdb $update_url/bin/cn_mini.mmdb
|
||||
[ "$?" = "1" ] && rm -rf $bindir/Country.mmdb && logger "数据库下载失败,已退出!" 31 && exit 1
|
||||
Geo_v=$(date +"%Y%m%d")
|
||||
setconfig Geo_v $Geo_v
|
||||
fi
|
||||
fi
|
||||
# if [ "$clashcore" = "clash.meta" -a ! -f $bindir/geosite.dat ];then
|
||||
# if [ -f $clashdir/geosite.dat ];then
|
||||
# mv $clashdir/geosite.dat $bindir/geosite.dat
|
||||
# else
|
||||
# logger "未找到geosite数据库,正在下载!" 33
|
||||
# $0 webget $bindir/geosite.dat $update_url/bin/geosite.dat
|
||||
# [ "$?" = "1" ] && rm -rf $bindir/geosite.dat && logger "数据库下载失败,已退出!" 31 && exit 1
|
||||
# fi
|
||||
# fi
|
||||
#检查dashboard文件
|
||||
if [ -f $clashdir/ui/index.html -a ! -f $bindir/ui/index.html ];then
|
||||
cp -rf $clashdir/ui $bindir
|
||||
@@ -685,6 +793,16 @@ bfstart(){
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
#预下载Geosite数据库
|
||||
if [ "$clashcore" = "clash.meta" ] && [ ! -f $bindir/geosite.dat ] && [ -n "$(cat $clashdir/config.yaml|grep -Ei 'geosite')" ];then
|
||||
if [ -f $clashdir/geosite.dat ];then
|
||||
mv $clashdir/geosite.dat $bindir/geosite.dat
|
||||
else
|
||||
logger "未找到geosite数据库,正在下载!" 33
|
||||
$0 webget $bindir/geosite.dat $update_url/bin/geosite.dat
|
||||
[ "$?" = "1" ] && rm -rf $bindir/geosite.dat && logger "数据库下载失败,已退出!" 31 && exit 1
|
||||
fi
|
||||
fi
|
||||
#本机代理准备
|
||||
if [ "$local_proxy" = "已开启" -a "$local_type" = "iptables增强模式" ];then
|
||||
if [ -z "$(id shellclash 2>/dev/null | grep 'root')" ];then
|
||||
@@ -723,21 +841,24 @@ afstart(){
|
||||
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
|
||||
[ "$redir_mod" = "Redir模式" ] && [ "$tproxy_mod" = "已开启" ] && start_udp
|
||||
[ "$local_proxy" = "已开启" ] && [ "$local_type" = "iptables增强模式" ] && start_output
|
||||
[ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && start_tun
|
||||
type iptables >/dev/null 2>&1 && start_wan
|
||||
#标记启动时间
|
||||
mark_time
|
||||
#设置本机代理
|
||||
[ "$local_proxy" = "已开启" ] && $0 set_proxy $mix_port $db_port
|
||||
#加载定时任务
|
||||
[ -f $clashdir/cron ] && croncmd $clashdir/cron
|
||||
#流媒体预解析
|
||||
if [ "$netflix_pre" = "已开启" -o "$disneyp_pre" = "已开启" ];then
|
||||
cronset '#ShellClash流媒体预解析' "* */$stearming_int * * * $clashdir/start.sh steaming #ShellClash流媒体预解析"
|
||||
$0 steaming & #后台执行流媒体预解析进程
|
||||
fi
|
||||
[ -f $clashdir/cron ] && croncmd $clashdir/cron
|
||||
#启用面板配置自动保存
|
||||
if [ "$restore" = false ];then
|
||||
cronset '#每10分钟保存节点配置' "*/10 * * * * test -n \"\$(pidof clash)\" && $clashdir/start.sh web_save #每10分钟保存节点配置"
|
||||
[ -f $clashdir/web_save ] && web_restore & #后台还原面板配置
|
||||
cronset '#每10分钟保存节点配置' "*/10 * * * * test -n \"\$(pidof clash)\" && $clashdir/start.sh web_save #每10分钟保存节点配置"
|
||||
[ -f $clashdir/web_save ] && web_restore & #后台还原面板配置
|
||||
#自动开启SSH
|
||||
[ "$mi_autoSSH" = "已启用" ] && autoSSH 2>/dev/null
|
||||
#流媒体预解析
|
||||
if [ "$netflix_pre" = "已开启" -o "$disneyP_pre" = "已开启" ];then
|
||||
cronset '#ShellClash流媒体预解析' "* */$streaming_int * * * test -n \"\$(pidof clash)\" && $clashdir/start.sh streaming #ShellClash流媒体预解析"
|
||||
sleep 1
|
||||
$0 streaming & #后台执行流媒体预解析进程
|
||||
fi
|
||||
else
|
||||
logger "clash服务启动失败!请查看报错信息!" 31
|
||||
@@ -752,7 +873,8 @@ start_old(){
|
||||
if [ "$local_proxy" = "已开启" -a "$local_type" = "iptables增强模式" ];then
|
||||
su shellclash -c "$bindir/clash -d $bindir >/dev/null" &
|
||||
else
|
||||
$bindir/clash -d $bindir >/dev/null &
|
||||
type nohup >/dev/null 2>&1 && nohup=nohup
|
||||
$nohup $bindir/clash -d $bindir >/dev/null 2>&1 &
|
||||
fi
|
||||
afstart
|
||||
$0 daemon
|
||||
@@ -791,6 +913,7 @@ stop)
|
||||
#删除守护进程&面板配置自动保存
|
||||
cronset "clash保守模式守护进程"
|
||||
cronset "保存节点配置"
|
||||
cronset "流媒体预解析"
|
||||
#多种方式结束进程
|
||||
if [ -f /etc/rc.common ];then
|
||||
/etc/init.d/clash stop >/dev/null 2>&1
|
||||
@@ -808,17 +931,22 @@ restart)
|
||||
init)
|
||||
if [ -d "/etc/storage/clash" ];then
|
||||
clashdir=/etc/storage/clash
|
||||
if [ -w "/opt/etc/profile" ];then
|
||||
profile=/opt/etc/profile
|
||||
else
|
||||
profile=/etc/profile
|
||||
sed -i '' $profile #将软链接转化为一般文件
|
||||
fi
|
||||
i=1
|
||||
while [ ! -w "/etc/profile" -a "$i" -lt 60 ];do
|
||||
sleep 1 && i=$((i+1))
|
||||
done
|
||||
profile=/etc/profile
|
||||
sed -i '' $profile #将软链接转化为一般文件
|
||||
elif [ -d "/jffs/clash" ];then
|
||||
clashdir=/jffs/clash
|
||||
profile=/jffs/configs/profile.add
|
||||
else
|
||||
clashdir=$(cd $(dirname $0);pwd)
|
||||
profile=/etc/profile
|
||||
fi
|
||||
[ -d "/jffs/clash" ] && clashdir=/jffs/clash && profile=/jffs/configs/profile.add
|
||||
echo "alias clash=\"$clashdir/clash.sh\"" >> $profile
|
||||
echo "export clashdir=\"$clashdir\"" >> $profile
|
||||
$0 start
|
||||
[ -f $clashdir/.dis_startup ] && cronset "clash保守模式守护进程" || $0 start
|
||||
;;
|
||||
getyaml)
|
||||
getconfig
|
||||
@@ -891,35 +1019,11 @@ unset_proxy)
|
||||
sed -i '/all_proxy/'d $profile
|
||||
sed -i '/ALL_PROXY/'d $profile
|
||||
;;
|
||||
steaming)
|
||||
#设置循环检测clashDNS端口
|
||||
i=1
|
||||
while [ $i -lt 10 ];do
|
||||
sleep 1
|
||||
nslookup baidu.com 127.0.0.1:${dns_port} > /dev/null 2>&1
|
||||
[ "$?" = 0 ] && i=10
|
||||
done
|
||||
getconfig
|
||||
steaming_dns(){
|
||||
steaming_dir=$clashdir/steaming/${steaming_type}_Domains.list
|
||||
if [ ! -f "$steaming_dir" ];then
|
||||
echo 未找到$steaming_type域名数据库,正在下载!
|
||||
mkdir -p $clashdir/steaming
|
||||
$0 webget "$steaming_dir" "$update_url/bin/${steaming_type}_Domains.list"
|
||||
[ "$?" = "1" ] && logger "$steaming_type数据库文件下载失败"
|
||||
fi
|
||||
if [ -f "$steaming_dir" ];then
|
||||
for line in $(cat $steaming_dir);do
|
||||
[ -n "$line" ] && nslookup "$line" 127.0.0.1:${dns_port}
|
||||
done >/dev/null 2>&1
|
||||
echo "$steaming_type域名预解析完成!"
|
||||
fi
|
||||
}
|
||||
echo
|
||||
echo "正在后台进行流媒体预解析服务,请耐心等待!"
|
||||
[ "$netflix_pre" = "已开启" ] && steaming_type=Netflix && steaming_dns
|
||||
[ "$disneyP_pre" = "已开启" ] && steaming_type=Disney_Plus && steaming_dns
|
||||
echo "请输入回车继续!"
|
||||
streaming)
|
||||
streaming
|
||||
;;
|
||||
db)
|
||||
$2
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
171
tools/ShellDDNS.sh
Normal file
171
tools/ShellDDNS.sh
Normal file
@@ -0,0 +1,171 @@
|
||||
#! /bin/bash
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
ddns_dir=/etc/config/ddns
|
||||
tmp_dir=/tmp/ddns_$USER
|
||||
|
||||
[ ! -f "$ddns_dir" -o ! -d "/etc/ddns" ] && echo -e "本脚本依赖OpenWrt内置的DDNS服务,当前设备无法运行,已退出!" && exit 1
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[30;46m欢迎使用ShellDDNS!\033[0m"
|
||||
echo -e "TG群:\033[36;4mhttps://t.me/clashfm\033[0m"
|
||||
|
||||
add_ddns(){
|
||||
cat >> $ddns_dir << EOF
|
||||
config service '$service'
|
||||
option enabled '1'
|
||||
option force_unit 'hours'
|
||||
option lookup_host '$domain'
|
||||
option service_name '$service_name'
|
||||
option domain '$domain'
|
||||
option username '$username'
|
||||
option use_https '0'
|
||||
option use_ipv6 '$use_ipv6'
|
||||
option password '$password'
|
||||
option ip_source 'web'
|
||||
option check_unit 'minutes'
|
||||
option check_interval '$check_interval'
|
||||
option force_interval '$force_interval'
|
||||
option interface 'wan'
|
||||
EOF
|
||||
/usr/lib/ddns/dynamic_dns_updater.sh -S $service start >/dev/null 2>&1 &
|
||||
sleep 3
|
||||
echo 服务已经添加!
|
||||
}
|
||||
set_ddns(){
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入你的域名 > " str
|
||||
[ -z "$str" ] && domain=$domain || domain=$str
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入用户名或邮箱 > " str
|
||||
[ -z "$str" ] && username=$username || username=$str
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入密码或令牌秘钥 > " str
|
||||
[ -z "$str" ] && password=$password || password=$str
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入检测更新间隔(单位:分钟;默认为10) > " check_interval
|
||||
[ -z "$check_interval" ] || [ "$check_interval" -lt 1 -o "$check_interval" -gt 1440 ] && check_interval=10
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入强制更新间隔(单位:小时;默认为24) > " force_interval
|
||||
[ -z "$force_interval" ] || [ "$force_interval" -lt 1 -o "$force_interval" -gt 240 ] && force_interval=24
|
||||
echo -----------------------------------------------
|
||||
echo -e "请核对如下信息:"
|
||||
echo -e "服务商: \033[32m$service\033[0m"
|
||||
echo -e "域名: \033[32m$domain\033[0m"
|
||||
echo -e "用户名: \033[32m$username\033[0m"
|
||||
echo -e "检测间隔: \033[32m$check_interval\033[0m"
|
||||
echo -----------------------------------------------
|
||||
read -p "确认添加?(1/0) > " res
|
||||
[ "$res" = 1 ] && add_ddns || set_ddns
|
||||
}
|
||||
|
||||
set_service(){
|
||||
services_dir=/etc/ddns/$services
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m请选择服务提供商\033[0m"
|
||||
cat $services_dir | grep -v '^#' | awk -F "[\"]" '{print " "NR" " $2}'
|
||||
nr=$(cat $services_dir | grep -v '^#' | wc -l)
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" ]; then
|
||||
i=
|
||||
elif [ "$num" -gt 0 -a "$num" -lt $nr ]; then
|
||||
service=$(cat $services_dir | grep -v '^#' | awk -F "[\".]" '{print $2}' | sed -n "$num"p)
|
||||
service_name=$(cat $services_dir | grep -v '^#' | awk -F "[\"]" '{print $2}' | sed -n "$num"p)
|
||||
set_ddns
|
||||
else
|
||||
echo "输入错误,请重新输入!"
|
||||
sleep 1
|
||||
set_service
|
||||
fi
|
||||
}
|
||||
|
||||
network_type(){
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[32m请选择网络模式\033[0m"
|
||||
echo -e " 1 \033[36mIPV4\033[0m"
|
||||
echo -e " 2 \033[36mIPV6\033[0m"
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" ]; then
|
||||
i=
|
||||
elif [ "$num" = 1 ];then
|
||||
use_ipv6=0
|
||||
services=services
|
||||
set_service
|
||||
elif [ "$num" = 2 ];then
|
||||
use_ipv6=1
|
||||
services=services_ipv6
|
||||
set_service
|
||||
else
|
||||
echo "输入错误,请重新输入!"
|
||||
sleep 1
|
||||
network_type
|
||||
fi
|
||||
}
|
||||
|
||||
rev_service(){
|
||||
enabled=$(uci show ddns.$service | grep 'enabled' | awk -F "\'" '{print $2}')
|
||||
[ "$enabled" = 1 ] && enabled_b="停用" || enabled_b="启用"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 \033[32m立即更新\033[0m"
|
||||
echo -e " 2 编辑当前服务\033[0m"
|
||||
echo -e " 3 $enabled_b当前服务"
|
||||
echo -e " 4 移除当前服务"
|
||||
echo -e " 0 返回上级菜单"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" -o "$num" = 0 ]; then
|
||||
i=
|
||||
elif [ "$num" = 1 ]; then
|
||||
/usr/lib/ddns/dynamic_dns_updater.sh -S $service start >/dev/null 2>&1 &
|
||||
sleep 3
|
||||
elif [ "$num" = 2 ]; then
|
||||
domain=$(uci show ddns.$service | grep 'domain' | awk -F "\'" '{print $2}')
|
||||
username=$(uci show ddns.$service | grep 'username' | awk -F "\'" '{print $2}')
|
||||
password=$(uci show ddns.$service | grep 'password' | awk -F "\'" '{print $2}')
|
||||
service_name=$(uci show ddns.$service | grep 'service_name' | awk -F "\'" '{print $2}')
|
||||
uci delete ddns.$service
|
||||
set_ddns
|
||||
elif [ "$num" = 3 ]; then
|
||||
[ "$enabled" = 1 ] && uci set ddns.$service.enabled='0' || uci set ddns.$service.enabled='1' && sleep 3
|
||||
uci commit ddns.$service
|
||||
elif [ "$num" = 4 ]; then
|
||||
uci delete ddns.$service
|
||||
uci commit ddns.$service
|
||||
fi
|
||||
}
|
||||
|
||||
load_ddns(){
|
||||
nr=0
|
||||
cat $ddns_dir | grep 'config service' | awk '{print $3}' | sed "s/\'//g" > $tmp_dir
|
||||
echo -----------------------------------------------
|
||||
echo -e "列表 域名 启用 IP地址"
|
||||
echo -----------------------------------------------
|
||||
for service in $(cat $tmp_dir) ;do
|
||||
echo $service >> $tmp_dir
|
||||
nr=$((nr+1))
|
||||
enabled=$(uci show ddns.$service | grep 'enabled' | awk -F "\'" '{print $2}')
|
||||
domain=$(uci show ddns.$service | grep 'domain' | awk -F "\'" '{print $2}')
|
||||
local_ip=$(cat /var/log/ddns/$service.log | grep 'Local IP' | tail -1 | awk -F "\'" '{print $2}')
|
||||
echo -e " $nr $domain $enabled $local_ip"
|
||||
done
|
||||
echo -e " $((nr+1)) 添加DDNS服务"
|
||||
echo -e " 0 退出"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应序号 > " num
|
||||
if [ -z "$num" -o "$num" = 0 ]; then
|
||||
i=
|
||||
elif [ "$num" -gt $nr ]; then
|
||||
network_type
|
||||
load_ddns
|
||||
elif [ "$num" -gt 0 -a "$num" -le $nr ]; then
|
||||
service=$(cat $tmp_dir | sed -n "$num"p)
|
||||
rev_service
|
||||
load_ddns
|
||||
else
|
||||
echo "请输入正确数字!" && load_ddns
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
load_ddns
|
||||
rm -rf $tmp_dir
|
||||
|
||||
Reference in New Issue
Block a user