1 Commits

Author SHA1 Message Date
juewuy
0b7f7161b0 ~1.9.4release 2026-02-15 19:19:19 +08:00
86 changed files with 6479 additions and 9568 deletions

View File

@@ -2,7 +2,7 @@ name: core_auto_update
on: on:
schedule: schedule:
- cron: 0 18 */3 * * - cron: 0 18 * * *
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -20,7 +20,6 @@ jobs:
auto_update_meta_alpha: auto_update_meta_alpha:
permissions: write-all permissions: write-all
needs: auto_update_singboxr_dev
uses: juewuy/ShellCrash/.github/workflows/update_meta_core.yaml@dev uses: juewuy/ShellCrash/.github/workflows/update_meta_core.yaml@dev
with: with:
tag1: MetaCubeX/mihomo tag1: MetaCubeX/mihomo

View File

@@ -1,90 +0,0 @@
name: core_easy_update
on:
workflow_dispatch:
inputs:
tag1:
description: 'meta or singbox or singboxr'
required: true
type: string
jobs:
get_version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- id: get_version
run: |
[ "${{ inputs.tag1 }}" = meta ] && repo="MetaCubeX/mihomo"
[ "${{ inputs.tag1 }}" = singbox ] && repo="SagerNet/sing-box"
[ "${{ inputs.tag1 }}" = singboxr ] && repo="SagerNet/sing-box"
latest_tag=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name)
[ "${{ inputs.tag1 }}" = singboxr ] && latest_tag="${latest_tag}-reF1nd"
echo "version=$latest_tag" >> $GITHUB_OUTPUT
update_meta_upx:
if: github.event.inputs.tag1 == 'meta'
needs: get_version
permissions: write-all
uses: juewuy/ShellCrash/.github/workflows/update_meta_core.yaml@dev
with:
tag1: MetaCubeX/mihomo
tag2: ${{ needs.get_version.outputs.version }}
tag4: meta
tag5: ""
tag6: upx
secrets: inherit
update_meta_tar:
if: github.event.inputs.tag1 == 'meta'
needs: [get_version, update_meta_upx]
permissions: write-all
uses: juewuy/ShellCrash/.github/workflows/update_meta_core.yaml@dev
with:
tag1: MetaCubeX/mihomo
tag2: ${{ needs.get_version.outputs.version }}
tag4: meta
tag5: ""
tag6: tar.gz
secrets: inherit
update_singboxr_upx:
if: github.event.inputs.tag1 == 'singboxr'
needs: get_version
permissions: write-all
uses: juewuy/ShellCrash/.github/workflows/update_singbox_core.yaml@dev
with:
tag1: reF1nd/sing-box
tag2: ${{ needs.get_version.outputs.version }}
tag4: singboxr
tag5: with_quic,with_utls,with_clash_api
tag6: upx
secrets: inherit
update_singboxr_tar:
if: github.event.inputs.tag1 == 'singboxr'
needs: [get_version, update_singboxr_upx]
permissions: write-all
uses: juewuy/ShellCrash/.github/workflows/update_singbox_core.yaml@dev
with:
tag1: reF1nd/sing-box
tag2: ${{ needs.get_version.outputs.version }}
tag4: singboxr
tag5: with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_tailscale
tag6: tar.gz
secrets: inherit
update_singbox_upx:
if: github.event.inputs.tag1 == 'singbox'
needs: get_version
permissions: write-all
uses: juewuy/ShellCrash/.github/workflows/update_singbox_core.yaml@dev
with:
tag1: SagerNet/sing-box
tag2: ${{ needs.get_version.outputs.version }}
tag4: singbox
tag5: with_quic,with_utls,with_clash_api
tag6: upx
secrets: inherit

View File

@@ -64,8 +64,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: go needs: go
env: env:
REPO: ${{ inputs.tag1 }} REPO: ${{ github.event.inputs.tag1 }}
TAGS: ${{ inputs.tag5 }} TAGS: ${{ github.event.inputs.tag5 }}
outputs: outputs:
version: ${{steps.meta.outputs.version}} version: ${{steps.meta.outputs.version}}
tags: ${{steps.meta.outputs.tags}} tags: ${{steps.meta.outputs.tags}}
@@ -74,7 +74,7 @@ jobs:
- name: get meta version - name: get meta version
id: meta id: meta
run: | run: |
version=${{ inputs.tag2 }} version=${{ github.event.inputs.tag2 }}
[ "$version" = Alpha ] && version="Alpha-$(date +"%Y%m%d")" [ "$version" = Alpha ] && version="Alpha-$(date +"%Y%m%d")"
echo version=$version >> $GITHUB_OUTPUT echo version=$version >> $GITHUB_OUTPUT
if [ -z "$TAGS" ];then if [ -z "$TAGS" ];then
@@ -137,8 +137,8 @@ jobs:
- name: Checkout meta - name: Checkout meta
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
repository: ${{ inputs.tag1 }} repository: ${{ github.event.inputs.tag1 }}
ref: ${{ inputs.tag2 }} ref: ${{ github.event.inputs.tag2 }}
fetch-depth: 1 fetch-depth: 1
- name: Setup Go - name: Setup Go
@@ -188,11 +188,11 @@ jobs:
- name: Zip core by upx - name: Zip core by upx
if: env.ZIPTYPE == 'upx' if: env.ZIPTYPE == 'upx'
run: | run: |
for upxv in 3.94 3.96 5.1.0;do wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
wget https://github.com/upx/upx/releases/download/v$upxv/upx-$upxv-amd64_linux.tar.xz wget https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz
tar xf upx-$upxv-amd64_linux.tar.xz tar xf upx-3.96-amd64_linux.tar.xz
done tar xf upx-3.94-amd64_linux.tar.xz
for arch in amd64 armv5 armv7 arm64 386 mips-softfloat mipsle-hardfloat mipsle-softfloat;do for arch in amd64 armv5 armv7 arm64 386 mips-softfloat mipsle-hardfloat mipsle-softfloat;do
[ ! -f ./tmp/linux-${arch}/meta ] && continue [ ! -f ./tmp/linux-${arch}/meta ] && continue
mv -f ./tmp/linux-${arch}/meta ./tmp/clash-linux-${arch}.upx mv -f ./tmp/linux-${arch}/meta ./tmp/clash-linux-${arch}.upx
@@ -201,15 +201,12 @@ jobs:
armv5|mips* ) armv5|mips* )
./upx-3.94-amd64_linux/upx --no-lzma ./tmp/clash-linux-${arch}.upx ./upx-3.94-amd64_linux/upx --no-lzma ./tmp/clash-linux-${arch}.upx
;; ;;
armv7|386)
./upx-3.96-amd64_linux/upx --no-lzma ./tmp/clash-linux-${arch}.upx
;;
*) *)
./upx-5.1.0-amd64_linux/upx ./tmp/clash-linux-${arch}.upx ./upx-3.96-amd64_linux/upx --no-lzma ./tmp/clash-linux-${arch}.upx
;; ;;
esac esac
done done
rm -rf upx-* rm -rf upx-3.9*
- name: Zip core by tar - name: Zip core by tar
if: env.ZIPTYPE == 'tar.gz' if: env.ZIPTYPE == 'tar.gz'
@@ -253,9 +250,9 @@ jobs:
if: ${{ env.RELEASE != '' && env.PUSHDIR == '' }} if: ${{ env.RELEASE != '' && env.PUSHDIR == '' }}
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
tag_name: ${{ inputs.tag3 }} tag_name: ${{ github.event.inputs.tag3 }}
name: ${{ inputs.tag3 }} name: ${{ github.event.inputs.tag3 }}
body: "The ${{env.VERSION}} version of ${{ inputs.tag1 }} \n这是${{ inputs.tag1 }}的${{env.VERSION}}版本内核文件\nhttps://github.com/${{ inputs.tag1 }}/releases \nOnly support for ShellCrash\n仅适配ShellCrash项目" body: "The ${{env.VERSION}} version of ${{ github.event.inputs.tag1 }} \n这是${{ github.event.inputs.tag1 }}的${{env.VERSION}}版本内核文件\nhttps://github.com/${{ github.event.inputs.tag1 }}/releases \nOnly support for ShellCrash\n仅适配ShellCrash项目"
draft: false draft: false
prerelease: true prerelease: true
files: | files: |

View File

@@ -88,7 +88,7 @@ jobs:
git fetch --tags sekai git fetch --tags sekai
version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag) version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag)
[ -z "$version" ] && version=${{ inputs.tag2 }} [ -z "$version" ] && version=${{ inputs.tag2 }}
version=$(echo ${version%-*}) version=$(echo $version | sed 's/-reF1nd//')
echo version=$version >> $GITHUB_OUTPUT echo version=$version >> $GITHUB_OUTPUT
if [ -z "$TAGS" ];then if [ -z "$TAGS" ];then
if [ "$REPO" = 'SagerNet/sing-box' ];then if [ "$REPO" = 'SagerNet/sing-box' ];then
@@ -208,10 +208,10 @@ jobs:
- name: Zip core by upx - name: Zip core by upx
if: env.ZIPTYPE == 'upx' if: env.ZIPTYPE == 'upx'
run: | run: |
for upxv in 3.94 3.96 5.1.0;do wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
wget https://github.com/upx/upx/releases/download/v$upxv/upx-$upxv-amd64_linux.tar.xz wget https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz
tar xf upx-$upxv-amd64_linux.tar.xz tar xf upx-3.96-amd64_linux.tar.xz
done tar xf upx-3.94-amd64_linux.tar.xz
for arch in amd64 armv5 armv7 arm64 386 mips-softfloat mipsle-hardfloat mipsle-softfloat;do for arch in amd64 armv5 armv7 arm64 386 mips-softfloat mipsle-hardfloat mipsle-softfloat;do
[ ! -f ./tmp/linux-${arch}/sing-box ] && continue [ ! -f ./tmp/linux-${arch}/sing-box ] && continue
mv -f ./tmp/linux-${arch}/sing-box ./tmp/singbox-linux-${arch}.upx mv -f ./tmp/linux-${arch}/sing-box ./tmp/singbox-linux-${arch}.upx
@@ -220,15 +220,12 @@ jobs:
armv5|mips* ) armv5|mips* )
./upx-3.94-amd64_linux/upx --no-lzma ./tmp/singbox-linux-${arch}.upx ./upx-3.94-amd64_linux/upx --no-lzma ./tmp/singbox-linux-${arch}.upx
;; ;;
armv7|386)
./upx-3.96-amd64_linux/upx --no-lzma ./tmp/singbox-linux-${arch}.upx
;;
*) *)
./upx-5.1.0-amd64_linux/upx ./tmp/singbox-linux-${arch}.upx ./upx-3.96-amd64_linux/upx --no-lzma ./tmp/singbox-linux-${arch}.upx
;; ;;
esac esac
done done
rm -rf upx-* rm -rf upx-3.9*
- name: Zip core by tar - name: Zip core by tar
if: env.ZIPTYPE == 'tar.gz' if: env.ZIPTYPE == 'tar.gz'

176
README.md
View File

@@ -1,178 +1,24 @@
<h1 align="center">ShellCrash</h1> <h1 align="center">
<br>ShellCrash<br>
</h1>
<p align="center">
<p align="center">
<a target="_blank" href="https://github.com/MetaCubeX/mihomo/releases">
<img src="https://img.shields.io/github/release/MetaCubeX/mihomo.svg?style=flat-square&label=Core">
</a>
<a target="_blank" href="https://github.com/juewuy/ShellCrash/releases"> <a target="_blank" href="https://github.com/juewuy/ShellCrash/releases">
<img src="https://img.shields.io/github/release/juewuy/ShellCrash.svg?style=flat-square&label=ShellCrash&colorB=green"> <img src="https://img.shields.io/github/release/juewuy/ShellCrash.svg?style=flat-square&label=ShellCrash&colorB=green">
</a> </a>
</p> </p>
<p align="center"> [中文](README_CN.md) | English
<strong>A powerful script tool for the convenient deployment and management of mihomo/sing-box kernels in Shell environments.</strong>
</p>
<p align="center"> ## Function introduction:
<a href="README_CN.md">简体中文</a> | English
</p>
--- ~Convenient use in Shell environment through management script [Crash](https://github.com/Dreamacro/Crash)<br>~Support management of [Crash functions](https://lancellc.gitbook.io/Crash)<br>~Support online import [Crash](https://github.com/Dreamacro/Crash) 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>
## :rocket: Core Features ## Equipment support:
- **Multi-Kernel Support**: Easily manage and switch between **mihomo** and **sing-box** kernels directly within the Shell environment. ~Support various router devices based on OpenWrt or secondary custom development using OpenWrt<br>~Support various devices running standard Linux systems (such as Debian/CenOS/Armbian, etc.)<br>~Compatible with Padavan firmware (conservative mode), Pandora firmware<br>~Compatible with various types of devices customized and developed using the Linux kernel<br>——————————<br>~For more device support, please submit an issue or go to the TG group for feedback (the device name and the device core information returned by running uname -a must be provided)<br>
- **Flexible Configuration Management**: Supports online import of subscription links and configuration files to simplify the setup process.
- **Automated Tasks**: Configure scheduled tasks for automatic updates of configuration files and rules.
- **Graphical Dashboard**: Support for online installation and use of local Web Dashboards to intuitively manage built-in rules and traffic.
- **Multiple Operation Modes**: Supports switching between various traffic forwarding modes, including Router mode and Local mode.
- **One-Click Maintenance**: Built-in online update functionality to keep the script and features up to date.
## :computer: Device Support
ShellCrash is designed to be compatible with the vast majority of network devices based on the Linux kernel:
* **Router Devices**: Supports various firmwares based on OpenWrt or its derivatives (e.g., Xiaomi, Netgear etc.).
* **Linux Servers**: Supports devices running standard Linux/GNU distributions (e.g., Debian, CentOS, Armbian, Ubuntu, etc.).
* **Third-Party Firmware**: Compatible with Padavan (Conservative Mode), Pandora, and ASUS/Merlin firmware.
* **Other Devices**: Compatible with other devices based on Linux/GNU or Linux/busybox.
* **Docker**Compatible with Docker environments (e.g., Synology, PVE, etc.).
> For additional device support, please submit an [Issue](https://github.com/juewuy/ShellCrash/issues) or provide feedback in the [Telegram Group](https://t.me/ShellClash) (please include the device model and the output of the `uname -a` command).
---
## :hammer_and_wrench: Installation Guide
> [!TIP]
> If you encounter connection failures or SSL-related issues, please try switching to an alternative installation mirror.
### Prerequisites
1. Ensure the device has **SSH** enabled and **Root privileges** obtained (Linux systems with a GUI can use the terminal directly).
2. Connect to the device using an SSH tool (such as PuTTY, JuiceSSH, or the system's built-in terminal).
### :penguin: Standard Linux Device Installation
> [!IMPORTANT]
> Please perform the installation as the root user.
> Install via wget (jsDelivr CDN source)
```sh
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@dev' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install_en.sh \
&& bash /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
> Or install via curl (Author's private source)
```sh
export url='https://gh.jwsc.eu.org/dev' && bash -c "$(curl -kfsSl $url/install_en.sh)" && . /etc/profile &> /dev/null
```
### :satellite: Router Device Installation
**Installation via `curl`:**
> GitHub Source (Recommended for overseas environments or environments with proxy access)
```sh
export url='https://raw.githubusercontent.com/juewuy/ShellCrash/dev' \
&& sh -c "$(curl -kfsSl $url/install_en.sh)" \
&& . /etc/profile &> /dev/null
```
> Or jsDelivr CDN source
```sh
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@dev' \
&& sh -c "$(curl -kfsSl $url/install_en.sh)" \
&& . /etc/profile &> /dev/null
```
> Or Author's private source
```sh
export url='https://gh.jwsc.eu.org/dev' && sh -c "$(curl -kfsSl $url/install_en.sh)" && . /etc/profile &> /dev/null
```
**Installation via `wget`:**
> GitHub Source (Recommended for overseas environments or environments with proxy access)
```sh
export url='https://raw.githubusercontent.com/juewuy/ShellCrash/dev' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install_en.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
> Or jsDelivr CDN source
```sh
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@dev' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install_en.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
### :pager: Installation for Legacy Devices with Older `wget` Versions
> Author's private HTTP beta source
```sh
export url='http://t.jwsc.eu.org' \
&& wget -q -O /tmp/install.sh $url/install_en.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
### :cloud: Virtual Machines
- **Alpine Linux VM**: It is highly recommended to use an Alpine image for optimal compatibility.
```sh
# Install necessary dependencies
apk add --no-cache wget openrc ca-certificates tzdata nftables iproute2 dcron
# Execute installation command
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@dev' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install_en.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
### :whale: Docker
Please visit the official Docker image:
- [ShellCrash on Docker Hub](https://hub.docker.com/r/juewuy/shellcrash)
### :package: Local Installation
If online installation is not possible, please follow the guide for local installation:
- [Local ShellCrash Installation Tutorial | Juewuy's Blog](https://juewuy.github.io/bdaz)
---
## :book: Usage Instructions
After installation, enter the following commands in the terminal to launch the management interface:
```shell
crash # Launch the interactive script menu
crash -h # View the list of command help
```
### Running Dependencies
| Component | Necessity | Description |
| :--- | :--- | :--- |
| curl / wget | Mandatory | Required for node saving, online installation, and update operations. |
| iptables / nftables | Critical | Without these, the script can only run in Pure Mode. |
| crontab | Low | Required for scheduled tasks; otherwise, they will not function. |
| net-tools | Very Low | Used for automatic port occupancy detection. |
| ubus / iproute-doc | Very Low | Used for automatically obtaining the local Host address. |
---
## :link: Related Links
- FAQ: [Juewuy's Blog](https://juewuy.github.io/chang-jian-wen-ti/)
- Changelog: [Release History](https://github.com/juewuy/ShellCrash/releases)
- Discussion: [Telegram Group](https://t.me/ShellClash)
## :scroll: License
This project is licensed under the [GNU General Public License v3.0](LICENSE.txt).

View File

@@ -1,7 +1,10 @@
<h1 align="center">ShellCrash</h1> <h1 align="center">
<br>ShellCrash<br>
</h1>
<p align="center">
<a target="_blank" href="https://github.com/MetaCubeX/mihomo/releases"> <p align="center">
<a target="_blank" href="https://github.com/MetaCubeX/mihomo/releases">
<img src="https://img.shields.io/github/release/MetaCubeX/mihomo.svg?style=flat-square&label=Core"> <img src="https://img.shields.io/github/release/MetaCubeX/mihomo.svg?style=flat-square&label=Core">
</a> </a>
<a target="_blank" href="https://github.com/juewuy/ShellCrash/releases"> <a target="_blank" href="https://github.com/juewuy/ShellCrash/releases">
@@ -9,183 +12,147 @@
</a> </a>
</p> </p>
<p align="center"> 中文 | [English](README.md)
<strong>一款在 Shell 环境下便捷部署与管理 mihomo/sing-box 内核的脚本工具</strong>
</p>
<p align="center"> 功能简介:
简体中文 | <a href="README.md">English</a> --
</p>
--- ~通过管理脚本在Shell环境下便捷使用Mihomo/Singbox内核<br>
~支持在Shell环境下管理<br>
~支持在线导入订阅及配置链接<br>
~支持配置定时任务,支持配置文件定时更新<br>
~支持在线安装及使用本地网页面板管理内置规则<br>
~支持路由模式、本机模式等多种模式切换<br>
~支持在线更新<br>
## :rocket: 核心特性 设备支持:
--
- **多内核支持**:在 Shell 环境下便捷管理及切换 **mihomo****sing-box** 内核。 ~支持各种基于OpenWrt或使用OpenWrt二次定制开发的路由器设备<br>
- **灵活配置管理**:支持在线导入订阅连结及配置文件,简化配置流程。 ~支持各种运行标准Linux系统如Debian/CenOS/Armbian等的设备<br>
- **自动化任务**:支持配置定时任务,实现配置文件与规则的自动定时更新。 ~兼容Padavan固件保守模式、潘多拉固件以及华硕/梅林固件<br>
- **图形化面板**:支持在线安装并使用本地 Web 面板Dashboard直观管理内置规则与流量。 ~兼容各类使用Linux内核定制开发的各类型设备<br>
- **多模式运行**:支持路由模式、本机模式等多种流量转发模式切换。
- **一键维护**:内置脚本在线更新功能,保持版本与功能的及时更迭。
## :computer: 设备支持 ——————————<br>
~更多设备支持请提issue或前往TG群反馈需提供设备名称及运行uname -a返回的设备核心信息<br>
ShellCrash 旨在兼容绝大多数基于 Linux 内核的网络设备 ## 常见问题
* **路由器设备**:支持各种基于 OpenWrt 或其二次开发固件(如 小米路由、网件路由等设备)。 [ShellCrash常见问题 | Juewuy's Blog](https://juewuy.github.io/chang-jian-wen-ti/)
* **Linux 服务器**:支持运行标准 Linux/GNU发行版如 Debian、CentOS、Armbian、Ubuntu 等)的设备。
* **第三方固件**:兼容 Padavan保守模式、潘多拉固件以及华硕/梅林固件。
* **其他设备**兼容各种基于Linux/GNU或者Linux/busybox开发的设备。
* **Docker**部分可能不兼容的设备如群辉、PVE支持docker环境运行。
> 更多设备支持,请提交 [Issue](https://github.com/juewuy/ShellCrash/issues) 或前往 [Telegram 群组](https://t.me/ShellClash) 反馈(请附上设备型号及 `uname -a` 命令的输出信息)。 ## 使用方式:
--- ~确认设备已经开启SSH并获取root权限带GUI桌面的Linux设备可使用自带终端安装<br>
~使用SSH连接工具如puttyJuiceSSH系统自带终端等路由器或Linux设备的SSH管理界面或终端界面
## :hammer_and_wrench: 安装指南 ~之后在SSH界面执行目标设备对应的安装命令并按照后续提示完成安装<br>
> [!TIP] ### 在线安装:<br>
> 若遇到连接失败或SSL相关问题请尝试切换至其他安装镜像站。
### 前置条件 **如无法连接或出现SSL连接错误请尝试更换各种不同的安装源**<br>
1. 确保设备已开启 **SSH** 并获得 **Root 权限**(带图形介面的 Linux 系统可直接使用终端)。
2. 使用 SSH 工具(如 Putty、JuiceSSH、或系统自带终端连接至设备。
### :penguin: 标准 Linux 设备安装 ~**标准Linux设备安装**<br>
> [!IMPORTANT]
> 请以 root 用户进行安装。
> 使用 wget 安装jsDelivr CDN 源)
```sh
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh \
&& bash /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
> 或使用 curl 安装(作者私人源)
```sh
export url='https://gh.jwsc.eu.org/master' \
&& bash -c "$(curl -kfsSl $url/install.sh)" \
&& . /etc/profile &> /dev/null
```
### :satellite: 路由器设备安装
**使用 `curl` 安装:**
> GitHub 源(推荐海外环境或具备代理环境使用)
```sh
export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' \
&& sh -c "$(curl -kfsSl $url/install.sh)" \
&& . /etc/profile &> /dev/null
```
> 或 jsDelivr CDN 源
```sh
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' \
&& sh -c "$(curl -kfsSl $url/install.sh)" \
&& . /etc/profile &> /dev/null
```
> 或作者私人源
```sh
export url='https://gh.jwsc.eu.org/master' \
&& sh -c "$(curl -kfsSl $url/install.sh)" \
&& . /etc/profile &> /dev/null
```
**使用 `wget` 安装:**
> GitHub 源(推荐海外环境或具备代理环境使用)
```sh
export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
> 或 jsDelivr CDN 源
```sh
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
### :pager: 老旧设备使用低版本 `wget` 安装
> 作者私人 http 内测源
```sh
export url='http://t.jwsc.eu.org' \
&& wget -q -O /tmp/install.sh $url/install.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
### :cloud: 虚拟机
- **Alpine Linux 虚拟机**:强烈建议使用 Alpine 镜像以获得最佳兼容性
```sh
# 安装必要依赖
apk add --no-cache wget openrc ca-certificates tzdata nftables iproute2 dcron
# 执行安装命令
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' \
&& wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh \
&& sh /tmp/install.sh \
&& . /etc/profile &> /dev/null
```
### :whale: Docker
请访问官方 Docker 镜像:
- [ShellCrash on Docker Hub](https://hub.docker.com/r/juewuy/shellcrash)
### :package: 本地安装
若无法进行在线安装,请参照以下指南执行本地安装:
- [本地安装ShellCrash教程 | Juewuy's Blog](https://juewuy.github.io/bdaz)
---
## :book: 使用说明
安装完成后,在终端输入以下指令即可启动管理界面:
```shell ```shell
crash # 启动脚本交互选单 sudo -i #切换到root用户如果需要密码请输入密码
crash -h # 查看命令帮助列表 export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && bash /tmp/install.sh && . /etc/profile &> /dev/null
```
或者
```shell
sudo -i #切换到root用户如果需要密码请输入密码
export url='https://gh.jwsc.eu.org/master' && bash -c "$(curl -kfsSl $url/install.sh)" && . /etc/profile &> /dev/null
``` ```
### 运行依赖说明 ~**路由设备使用curl安装**<br>
| 依赖组件 | 必要性 | 说明 |
| :--- | :--- | :--- |
| curl / wget | 必须 | 缺少时将无法进行节点保存、在线安装及更新操作 |
| iptables / nftables | 重要 | 缺少时仅能运行于纯淨模式 |
| crontab | 较低 | 缺少时定时任务功能将失效 |
| net-tools | 极低 | 缺少时无法自动检测端口占用 |
| ubus / iproute-doc | 极低 | 缺少时无法自动获取本机 Host 地址 |
--- ```shell
#GitHub源(可能需要代理)
export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && . /etc/profile &> /dev/null
```
或者
```shell
#jsDelivrCDN源
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && . /etc/profile &> /dev/null
```
或者
```shell
#作者私人源
export url='https://gh.jwsc.eu.org/master' && sh -c "$(curl -kfsSl $url/install.sh)" && . /etc/profile &> /dev/null
```
## :link: 相关链接 ~**路由设备使用wget安装**<br>
- 常见问题:[Juewuy's Blog](https://juewuy.github.io/chang-jian-wen-ti/)
- 更新日志:[Release History](https://github.com/juewuy/ShellCrash/releases)
- 交流反馈:[Telegram 讨论组](https://t.me/ShellClash)
--- ```Shell
#GitHub源(可能需要代理)
export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && . /etc/profile &> /dev/null
```
或者
```shell
#jsDelivrCDN源
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && . /etc/profile &> /dev/null
```
## :scroll: 许可协议 ~**老旧设备使用低版本wge安装**<br>
本项目采用[GNU通用公共许可证第3.0版](LICENSE.txt)授权。 ```Shell
#作者私人http内测源
export url='http://t.jwsc.eu.org' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && . /etc/profile &> /dev/null
```
--- ##### ~**虚拟机安装:**<br>
## :airplane: 机场推荐 虚拟机环境强烈建议使用Alpine镜像安装<br>
- [**大米**](https://1s.bigmeok.me/user#/register?code=2PuWY9I7),群友力荐,流媒体解锁,月付推荐。 ```shell
#安装必要依赖
apk add --no-cache wget openrc ca-certificates tzdata nftables iproute2 dcron
#执行安装命令
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && . /etc/profile &> /dev/null
```
##### ~Docker安装<br>
请前往[ShellCrash官方Docker镜像](https://hub.docker.com/r/juewuy/shellcrash)
### **本地安装:**<br>
如使用在线安装出现问题,请参考:[本地安装ShellCrash的教程 | Juewuy's Blog](https://juewuy.github.io/bdaz) 使用本地安装!<br>
### 使用脚本:<br>
安装完成管理脚本后,执行如下命令使用~
```Shell
crash #进入对话
crash -h #帮助列表
```
#### **运行时的额外依赖**<br>
> 大部分的设备/系统都已经预装了以下的大部分依赖,使用时如无影响可以无视之
```shell
curl/wget 必须 全部缺少时无法在线安装及更新,无法使用节点保存功能
iptables/nftables 重要 缺少时只能使用纯净模式
crontab 较低 缺少时无法启用定时任务功能
net-tools 极低 缺少时无法正常检测端口占用
ubus/iproute-doc 极低 缺少时无法正常获取本机host地址
```
更新日志:
--
### [点击查看](https://github.com/juewuy/ShellCrash/releases)
交流反馈:
--
### [TG讨论组](https://t.me/ShellClash)
机场推荐:
--
#### [Dler-墙洞,多年稳定运行,功能齐全](https://dler.pro/auth/register?affid=89698)<br>
#### [大米-群友力荐,流媒体解锁,月付推荐](https://1s.bigmeok.me/user#/register?code=2PuWY9I7)<br>

Binary file not shown.

View File

@@ -1,4 +1,4 @@
meta_v=v1.19.17 meta_v=v1.19.17
singboxr_v=1.13.0-alpha.27 singboxr_v=1.13.0-alpha.27
versionsh=1.9.5alpha11 versionsh=1.9.4release
GeoIP_v=20251205 GeoIP_v=20251205

View File

@@ -1,25 +1,23 @@
#!/bin/sh #!/usr/bin/env bash
# Copyright (C) Juewuy # Copyright (C) Juewuy
[ -z "$url" ] && url="https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@dev"
type bash &>/dev/null && shtype=bash || shtype=sh
[ -n "$(echo -e | grep e)" ] && echo=echo || echo='echo -e'
echo "***********************************************" echo "***********************************************"
echo "** 欢迎使用 **" echo "** 欢迎使用 **"
echo "** ShellCrash **" echo "** ShellCrash **"
echo "** by Juewuy **" echo "** by Juewuy **"
echo "***********************************************" echo "***********************************************"
language=chs # Check available capacity
[ -z "$url" ] && url="https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master"
# 内置工具
cecho() {
printf '%b\n' "$*"
}
dir_avail() { dir_avail() {
df -h >/dev/null 2>&1 && h="$2" df -h >/dev/null 2>&1 && h="$2"
df -P $h "${1:-.}" 2>/dev/null | awk 'NR==2 {print $4}' df -P $h "${1:-.}" 2>/dev/null | awk 'NR==2 {print $4}'
} }
ckcmd() {
if command -v sh >/dev/null 2>&1; then ckcmd() { #检查命令
if command -v sh >/dev/null 2>&1;then
command -v "$1" >/dev/null 2>&1 command -v "$1" >/dev/null 2>&1
else else
type "$1" >/dev/null 2>&1 type "$1" >/dev/null 2>&1
@@ -31,7 +29,7 @@ webget() {
if curl --version >/dev/null 2>&1; then if curl --version >/dev/null 2>&1; then
[ "$3" = "echooff" ] && progress='-s' || progress='-#' [ "$3" = "echooff" ] && progress='-s' || progress='-#'
[ -z "$4" ] && redirect='-L' || redirect='' [ -z "$4" ] && redirect='-L' || redirect=''
result=$(curl -w %{http_code} --connect-timeout 5 "$progress" "$redirect" -ko "$1" "$2") result=$(curl -w %{http_code} --connect-timeout 5 $progress $redirect -ko $1 $2)
[ -n "$(echo $result | grep -e ^2)" ] && result="200" [ -n "$(echo $result | grep -e ^2)" ] && result="200"
else else
if wget --version >/dev/null 2>&1; then if wget --version >/dev/null 2>&1; then
@@ -42,331 +40,296 @@ webget() {
fi fi
[ "$3" = "echoon" ] && progress='' [ "$3" = "echoon" ] && progress=''
[ "$3" = "echooff" ] && progress='-q' [ "$3" = "echooff" ] && progress='-q'
wget "$progress" "$redirect" "$certificate" "$timeout" -O "$1" "$2" wget $progress $redirect $certificate $timeout -O $1 $2
[ $? -eq 0 ] && result="200" [ $? -eq 0 ] && result="200"
fi fi
} }
error_down() { error_down() {
cecho "请参考 \033[32mhttps://github.com/juewuy/ShellCrash/blob/master/README_CN.md" $echo "请参考 \033[32mhttps://github.com/juewuy/ShellCrash/blob/master/README_CN.md"
cecho "\033[33m使用其他安装源重新安装\033[0m" $echo "\033[33m使用其他安装源重新安装\033[0m"
} }
# 安装及初始化 #安装及初始化
set_alias() { set_alias() {
while true; do echo "-----------------------------------------------"
echo "-----------------------------------------------" $echo "\033[36m请选择一个别名或使用自定义别名\033[0m"
cecho "\033[36m请选择一个别名或使用自定义别名\033[0m" echo "-----------------------------------------------"
echo "-----------------------------------------------" $echo " 1 【\033[32mcrash\033[0m】"
cecho " 1 【\033[32mcrash\033[0m】" $echo " 2 【\033[32m sc \033[0m】"
cecho " 2 【\033[32m sc \033[0m】" $echo " 3 【\033[32m mm \033[0m】"
cecho " 3 【\033[32m mm \033[0m】" $echo " 0 退出安装"
cecho " 0 退出安装" echo "-----------------------------------------------"
echo "-----------------------------------------------" read -p "请输入相应数字或自定义别名 > " res
read -p "请输入相应数字或自定义别名 > " res case "$res" in
case "$res" in 1) my_alias=crash ;;
0) 2) my_alias=sc ;;
echo "安装已取消" 3) my_alias=mm ;;
exit 1 0) echo "安装已取消"; exit 1 ;;
;; *) my_alias=$res ;;
1) esac
my_alias=crash cmd=$(ckcmd "$my_alias" | grep 'menu.sh')
;; ckcmd "$my_alias" && [ -z "$cmd" ] && {
2) $echo "\033[33m此别名和当前系统内置命令/别名冲突,请换一个!\033[0m"
my_alias=sc sleep 1
;; set_alias
3) }
my_alias=mm
;;
*)
my_alias=$res
;;
esac
cmd=$(ckcmd "$my_alias" | grep 'menu.sh')
ckcmd "$my_alias" && [ -z "$cmd" ] && {
cecho "\033[33m此别名和当前系统内置命令/别名冲突,请换一个!\033[0m"
sleep 1
continue
}
break
done
} }
gettar() { gettar() {
webget /tmp/ShellCrash.tar.gz "$url/ShellCrash.tar.gz" >/dev/null 2>&1 webget /tmp/ShellCrash.tar.gz "$url/ShellCrash.tar.gz"
if [ "$result" != "200" ]; then if [ "$result" != "200" ]; then
cecho "\033[33m文件下载失败\033[0m" $echo "\033[33m文件下载失败\033[0m"
error_down error_down
exit 1 exit 1
else else
"$CRASHDIR"/start.sh stop 2>/dev/null $CRASHDIR/start.sh stop 2>/dev/null
# 解压 #解压
echo "-----------------------------------------------" echo "-----------------------------------------------"
echo "开始解压文件!" echo 开始解压文件!
mkdir -p "$CRASHDIR" >/dev/null mkdir -p $CRASHDIR >/dev/null
tar -zxf '/tmp/ShellCrash.tar.gz' -C "$CRASHDIR"/ || tar -zxf '/tmp/ShellCrash.tar.gz' --no-same-owner -C "$CRASHDIR"/ tar -zxf '/tmp/ShellCrash.tar.gz' -C $CRASHDIR/ || tar -zxf '/tmp/ShellCrash.tar.gz' --no-same-owner -C $CRASHDIR/
if [ -s "$CRASHDIR"/init.sh ]; then if [ -s $CRASHDIR/init.sh ]; then
set_alias set_alias
. "$CRASHDIR"/init.sh >/dev/null . $CRASHDIR/init.sh >/dev/null
[ "$?" != 0 ] && cecho "\033[33m初始化失败请尝试本地安装\033[0m" && exit 1 [ "$?" != 0 ] && $echo "\033[33m初始化失败请尝试本地安装\033[0m" && exit 1
else else
rm -rf /tmp/ShellCrash.tar.gz rm -rf /tmp/ShellCrash.tar.gz
cecho "\033[33m文件解压失败\033[0m" $echo "\033[33m文件解压失败\033[0m"
error_down error_down
exit 1 exit 1
fi fi
fi fi
} }
set_usb_dir() { setdir() {
while true; do set_usb_dir() {
cecho "请选择安装目录" $echo "请选择安装目录"
du -hL /mnt | awk '{print " "NR" "$2" "$1}' du -hL /mnt | awk '{print " "NR" "$2" "$1}'
read -p "请输入相应数字 > " num read -p "请输入相应数字 > " num
dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p) dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
if [ -z "$dir" ]; then if [ -z "$dir" ]; then
cecho "\033[31m输入错误请重新设置\033[0m" $echo "\033[31m输入错误请重新设置\033[0m"
continue set_usb_dir
fi fi
break 1 }
done set_asus_dir() {
} echo -e "请选择U盘目录"
set_xiaomi_dir() { du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print " "NR" "$2" "$1}'
cecho "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m" read -p "请输入相应数字 > " num
[ -d /data ] && cecho " 1 安装到 /data 目录,剩余空间:$(dir_avail /data -h)(支持软固化功能)" dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p)
[ -d /userdisk ] && cecho " 2 安装到 /userdisk 目录,剩余空间:$(dir_avail /userdisk -h)(支持软固化功能)" if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then
[ -d /data/other_vol ] && cecho " 3 安装到 /data/other_vol 目录,剩余空间:$(dir_avail /data/other_vol -h)(支持软固化功能)" echo -e "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m"
cecho " 4 安装到自定义目录(不推荐,不明勿用!)" set_asus_dir
cecho " 0 退出安装" fi
echo "-----------------------------------------------" }
read -p "请输入相应数字 > " num set_cust_dir() {
case "$num" in
1)
dir=/data
;;
2)
dir=/userdisk
;;
3)
dir=/data/other_vol
;;
4)
set_cust_dir
;;
*)
exit 1
;;
esac
}
set_asus_usb() {
while true; do
echo -e "请选择U盘目录"
du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print " "NR" "$2" "$1}'
read -p "请输入相应数字 > " num
dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p)
if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then
echo -e "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m"
sleep 1
else
break
fi
done
}
set_asus_dir() {
cecho "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m"
cecho " 1 基于U盘+下载大师安装(支持所有固件限ARM设备须插入U盘或移动硬盘)"
cecho " 2 基于自启脚本安装(仅支持部分梅林固件)"
cecho " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
case "$num" in
1)
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
sleep 2
set_asus_usb
;;
2)
cecho "如开机无法正常自启请重新使用U盘+下载大师安装!"
sleep 2
dir=/jffs
;;
*)
exit 1
;;
esac
}
set_cust_dir() {
while true; do
echo "-----------------------------------------------" echo "-----------------------------------------------"
echo '可用路径 剩余空间' echo '可用路径 剩余空间:'
df -h | awk '{print $6,$4}' | sed 1d df -h | awk '{print $6,$4}' | sed 1d
echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!' echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir read -p "请输入自定义路径 > " dir
if [ "$(dir_avail "$dir")" = 0 ] || [ -n "$(echo "$dir" | grep -Eq '^/(tmp|opt|sys)(/|$)')" ]; then if [ "$(dir_avail $dir)" = 0 ] || [ -n "$(echo $dir | grep -E 'tmp|opt|sys')" ]; then
cecho "\033[31m路径错误请重新设置\033[0m" $echo "\033[31m路径错误请重新设置\033[0m"
continue set_cust_dir
fi fi
break 1 }
done echo "-----------------------------------------------"
} $echo "\033[33m注意安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m"
if [ -n "$systype" ]; then
[ "$systype" = "Padavan" ] && dir=/etc/storage
[ "$systype" = "mi_snapshot" ] && {
$echo "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m"
[ -d /data ] && $echo " 1 安装到 /data 目录,剩余空间:$(dir_avail /data -h)(支持软固化功能)"
[ -d /userdisk ] && $echo " 2 安装到 /userdisk 目录,剩余空间:$(dir_avail /userdisk -h)(支持软固化功能)"
[ -d /data/other_vol ] && $echo " 3 安装到 /data/other_vol 目录,剩余空间:$(dir_avail /data/other_vol -h)(支持软固化功能)"
$echo " 4 安装到自定义目录(不推荐,不明勿用!)"
$echo " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
case "$num" in
1)
dir=/data
;;
2)
dir=/userdisk
;;
3)
dir=/data/other_vol
;;
4)
set_cust_dir
;;
*)
exit 1
;;
esac
}
[ "$systype" = "asusrouter" ] && {
$echo "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m"
$echo " 1 基于USB设备安装(限23年9月之前固件须插入\033[31m任意\033[0mUSB设备)"
$echo " 2 基于自启脚本安装(仅支持梅林及部分非koolshare官改固件)"
$echo " 3 基于U盘+下载大师安装(支持所有固件限ARM设备须插入U盘或移动硬盘)"
$echo " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
case "$num" in
1)
read -p "将脚本安装到USB存储/系统闪存?(1/0) > " res
[ "$res" = "1" ] && set_usb_dir || dir=/jffs
usb_status=1
;;
2)
$echo "如无法正常开机启动请重新使用USB方式安装"
sleep 2
dir=/jffs
;;
3)
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
sleep 2
set_asus_dir
;;
*)
exit 1
;;
esac
}
[ "$systype" = "ng_snapshot" ] && dir=/tmp/mnt
else
$echo " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)"
$echo " 2 在\033[32m/usr/share目录\033[0m下安装(适合Linux系统)"
$echo " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)"
$echo " 4 在\033[32m外置存储\033[0m中安装"
$echo " 5 手动设置安装目录"
$echo " 0 退出安装"
echo "----------------------------------------------"
read -p "请输入相应数字 > " num
#设置目录
case "$num" in
1)
dir=/etc
;;
2)
dir=/usr/share
;;
3)
dir=~/.local/share
mkdir -p ~/.config/systemd/user
;;
4)
set_usb_dir
;;
5)
set_cust_dir
;;
*)
echo "安装已取消"
exit 1
;;
esac
fi
setdir() { if [ ! -w $dir ]; then
while true; do $echo "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" && sleep 1 && setdir
echo "-----------------------------------------------" else
cecho "\033[33m注意安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m" $echo "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail $dir -h)"
case "$systype" in read -p "确认安装?(1/0) > " res
Padavan) dir=/etc/storage ;; [ "$res" = "1" ] && CRASHDIR=$dir/ShellCrash || setdir
mi_snapshot) set_xiaomi_dir ;; fi
asusrouter) set_asus_dir ;;
ng_snapshot) dir=/tmp/mnt ;;
*)
cecho " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)"
cecho " 2 在\033[32m/usr/share目录\033[0m下安装(适合Linux系统)"
cecho " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)"
cecho " 4 在\033[32m外置存储\033[0m中安装"
cecho " 5 手动设置安装目录"
cecho " 0 退出安装"
echo "----------------------------------------------"
read -p "请输入相应数字 > " num
# 设置目录
case "$num" in
1)
dir=/etc
;;
2)
dir=/usr/share
;;
3)
dir=~/.local/share
mkdir -p ~/.config/systemd/user
;;
4)
set_usb_dir
;;
5)
set_cust_dir
;;
*)
echo "安装已取消"
exit 1
;;
esac
;;
esac
if [ ! -w "$dir" ]; then
cecho "\033[31m没有$dir目录写入权限!请重新设置!\033[0m"
sleep 1
else
cecho "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail "$dir" -h)"
read -p "确认安装?(1/0) > " res
if [ "$res" = "1" ]; then
CRASHDIR="$dir"/ShellCrash
break
fi
fi
done
} }
install() { install() {
echo "-----------------------------------------------" echo "-----------------------------------------------"
echo "开始从服务器获取安装文件!" echo 开始从服务器获取安装文件!
echo "-----------------------------------------------" echo "-----------------------------------------------"
gettar gettar
echo "-----------------------------------------------" echo "-----------------------------------------------"
echo "ShellCrash 已经安装成功!" echo "ShellCrash 已经安装成功!"
[ "$profile" = "~/.bashrc" ] && echo "请执行【. ~/.bashrc > /dev/null】命令以更新环境变量!" [ "$profile" = "~/.bashrc" ] && echo "请执行【. ~/.bashrc > /dev/null】命令以加载环境变量!"
[ -n "$(ls -l /bin/sh | grep -oE 'zsh')" ] && echo "请执行【. ~/.zshrc > /dev/null】命令以更新环境变量!" [ -n "$(ls -l /bin/sh | grep -oE 'zsh')" ] && echo "请执行【. ~/.zshrc > /dev/null】命令以加载环境变量!"
echo "-----------------------------------------------" echo "-----------------------------------------------"
cecho "\033[33m输入\033[30;47m $my_alias \033[0;33m命令即可管理\033[0m" $echo "\033[33m输入\033[30;47m $my_alias \033[0;33m命令即可管理\033[0m"
echo "-----------------------------------------------" echo "-----------------------------------------------"
} }
setversion() { setversion() {
echo "-----------------------------------------------" echo "-----------------------------------------------"
cecho "\033[33m请选择想要安装的版本\033[0m" $echo "\033[33m请选择想要安装的版本\033[0m"
cecho " 1 \033[32m公测版(推荐)\033[0m" $echo " 1 \033[32m公测版(推荐)\033[0m"
cecho " 2 \033[36m稳定版\033[0m" $echo " 2 \033[36m稳定版\033[0m"
cecho " 3 \033[31m开发版\033[0m" $echo " 3 \033[31m开发版\033[0m"
echo "-----------------------------------------------" echo "-----------------------------------------------"
read -p "请输入相应数字 > " num read -p "请输入相应数字 > " num
case "$num" in case "$num" in
1) release_type=master ;; 2)
2) release_type=stable ;; url=$(echo $url | sed 's/master/stable/')
3) release_type=dev ;; ;;
3)
url=$(echo $url | sed 's/master/dev/')
;;
*) ;; *) ;;
esac esac
url=$(echo "$url" | sed "s/master/$release_type/")
} }
#特殊固件识别及标记
[ -f "/etc/storage/started_script.sh" ] && {
systype=Padavan #老毛子固件
initdir='/etc/storage/started_script.sh'
}
[ -d "/jffs" ] && {
systype=asusrouter #华硕固件
[ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter'
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
}
[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot #小米设备
[ -w "/var/mnt/cfg/firewall" ] && systype=ng_snapshot #NETGEAR设备
# 安装检查 #检查root权限
check_systype() { if [ "$USER" != "root" -a -z "$systype" ]; then
[ -f "/etc/storage/started_script.sh" ] && { echo 当前用户:$USER
systype=Padavan #老毛子固件 $echo "\033[31m请尽量使用root用户不要直接使用sudo命令执行安装!\033[0m"
initdir='/etc/storage/started_script.sh' echo "-----------------------------------------------"
} read -p "仍要安装?可能会产生未知错误!(1/0) > " res
[ -d "/jffs" ] && { [ "$res" != "1" ] && exit 1
systype=asusrouter #华硕固件 fi
[ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter'
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
}
[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot #小米设备
[ -w "/var/mnt/cfg/firewall" ] && systype=ng_snapshot #NETGEAR设备
}
check_user() {
if [ "$USER" != "root" ] && [ -z "$systype" ]; then
echo "当前用户:$USER"
cecho "\033[31m请尽量使用root用户不要直接使用sudo命令执行安装!\033[0m"
echo "-----------------------------------------------"
read -p "仍要安装?可能会产生未知错误!(1/0) > " res
[ "$res" != "1" ] && exit 1
fi
}
check_version() {
echo "$url" | grep -q 'master' && setversion
webget /tmp/version "$url/version" echooff
[ "$result" = "200" ] && versionsh=$(cat /tmp/version)
rm -rf /tmp/version
# 输出 if [ -n "$(echo $url | grep master)" ]; then
cecho "最新版本:\033[32m$versionsh\033[0m" setversion
echo "-----------------------------------------------" fi
cecho "\033[44m如遇问题请加TG群反馈\033[42;30m t.me/ShellClash \033[0m" #获取版本信息
cecho "\033[37m支持各种基于openwrt的路由器设备" webget /tmp/version "$url/version" echooff
cecho "\033[33m支持Debian、Centos等标准Linux系统\033[0m" [ "$result" = "200" ] && versionsh=$(cat /tmp/version)
} rm -rf /tmp/version
check_dir() {
if [ -n "$CRASHDIR" ]; then
echo "-----------------------------------------------"
cecho "检测到旧的安装目录\033[36m$CRASHDIR\033[0m是否覆盖安装"
cecho "\033[32m覆盖安装时不会移除配置文件\033[0m"
echo " 1 覆盖安装"
echo " 2 卸载旧版本并安装"
echo " 0 取消安装"
read -p "请输入相应数字 > " num
case "$num" in
1)
install
;;
2)
[ "$CRASHDIR" != "/" ] && rm -rf "$CRASHDIR"
echo "-----------------------------------------------"
cecho "\033[31m 旧版本文件已卸载!\033[0m"
setdir
install
;;
9)
echo "测试模式,变更安装位置 $CRASHDIR"
setdir
install
;;
*)
cecho "\033[31m已取消安装\033[0m"
exit 1
;;
esac
else
setdir
install
fi
}
check_systype #输出
check_user $echo "最新版本:\033[32m$versionsh\033[0m"
check_version echo "-----------------------------------------------"
check_dir $echo "\033[44m如遇问题请加TG群反馈\033[42;30m t.me/ShellClash \033[0m"
$echo "\033[37m支持各种基于openwrt的路由器设备"
$echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m"
if [ -n "$CRASHDIR" ]; then
echo "-----------------------------------------------"
$echo "检测到旧的安装目录\033[36m$CRASHDIR\033[0m是否覆盖安装"
$echo "\033[32m覆盖安装时不会移除配置文件\033[0m"
read -p "覆盖安装/卸载旧版本?(1/0) > " res
case "$res" in
1)
install
;;
0)
rm -rf $CRASHDIR
echo "-----------------------------------------------"
$echo "\033[31m 旧版本文件已卸载!\033[0m"
setdir
install
;;
9)
echo "测试模式,变更安装位置"
setdir
install
;;
*)
$echo "\033[31m输入错误已取消安装\033[0m"
exit 1
;;
esac
else
setdir
install
fi

View File

@@ -1,372 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
echo "***********************************************"
echo "** Welcome to **"
echo "** ShellCrash **"
echo "** by Juewuy **"
echo "***********************************************"
language=en
[ -z "$url" ] && url="https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master"
# Internal Tools
cecho() {
printf '%b\n' "$*"
}
dir_avail() {
df -h >/dev/null 2>&1 && h="$2"
df -P $h "${1:-.}" 2>/dev/null | awk 'NR==2 {print $4}'
}
ckcmd() {
if command -v sh >/dev/null 2>&1; then
command -v "$1" >/dev/null 2>&1
else
type "$1" >/dev/null 2>&1
fi
}
webget() {
# Parameter [$1] Download Path, [$2] Online URL
# Parameter [$3] Display Output, [$4] Disable Redirects
if curl --version >/dev/null 2>&1; then
[ "$3" = "echooff" ] && progress='-s' || progress='-#'
[ -z "$4" ] && redirect='-L' || redirect=''
result=$(curl -w %{http_code} --connect-timeout 5 "$progress" "$redirect" -ko "$1" "$2")
[ -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'
[ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
certificate='--no-check-certificate'
timeout='--timeout=3'
fi
[ "$3" = "echoon" ] && progress=''
[ "$3" = "echooff" ] && progress='-q'
wget "$progress" "$redirect" "$certificate" "$timeout" -O "$1" "$2"
[ $? -eq 0 ] && result="200"
fi
}
error_down() {
cecho "Please refer to \033[32mhttps://github.com/juewuy/ShellCrash/blob/master/README.md"
cecho "\033[33mUse an alternative source to reinstall!\033[0m"
}
# Installation and Initialization
set_alias() {
while true; do
echo "-----------------------------------------------"
cecho "\033[36mPlease select an alias or enter a custom one:\033[0m"
echo "-----------------------------------------------"
cecho " 1 【\033[32mcrash\033[0m】"
cecho " 2 【\033[32m sc \033[0m】"
cecho " 3 【\033[32m mm \033[0m】"
cecho " 0 Exit Installation"
echo "-----------------------------------------------"
read -p "Enter number or custom alias > " res
case "$res" in
0)
echo "Installation cancelled"
exit 1
;;
1)
my_alias=crash
;;
2)
my_alias=sc
;;
3)
my_alias=mm
;;
*)
my_alias=$res
;;
esac
cmd=$(ckcmd "$my_alias" | grep 'menu.sh')
ckcmd "$my_alias" && [ -z "$cmd" ] && {
cecho "\033[33mThis alias conflicts with a system command; please choose another!\033[0m"
sleep 1
continue
}
break
done
}
gettar() {
webget /tmp/ShellCrash.tar.gz "$url/ShellCrash.tar.gz" >/dev/null 2>&1
if [ "$result" != "200" ]; then
cecho "\033[33mFile download failed!\033[0m"
error_down
exit 1
else
"$CRASHDIR"/start.sh stop 2>/dev/null
# Extract
echo "-----------------------------------------------"
echo "Starting file extraction!"
mkdir -p "$CRASHDIR" >/dev/null
tar -zxf '/tmp/ShellCrash.tar.gz' -C "$CRASHDIR"/ || tar -zxf '/tmp/ShellCrash.tar.gz' --no-same-owner -C "$CRASHDIR"/
if [ -s "$CRASHDIR"/init.sh ]; then
set_alias
. "$CRASHDIR"/init.sh >/dev/null
[ "$?" != 0 ] && cecho "\033[33mInitialization failed, try local installation!\033[0m" && exit 1
else
rm -rf /tmp/ShellCrash.tar.gz
cecho "\033[33mFile extraction failed!\033[0m"
error_down
exit 1
fi
fi
}
set_usb_dir() {
while true; do
cecho "Please select installation directory"
du -hL /mnt | awk '{print " "NR" "$2" "$1}'
read -p "Enter number > " num
dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
if [ -z "$dir" ]; then
cecho "\033[31mInvalid input! Please try again!\033[0m"
continue
fi
break 1
done
}
set_xiaomi_dir() {
cecho "\033[33mXiaomi device detected, please select installation location\033[0m"
[ -d /data ] && cecho " 1 Install to /data, Free space: $(dir_avail /data -h) (Supports soft-hardening)"
[ -d /userdisk ] && cecho " 2 Install to /userdisk, Free space: $(dir_avail /userdisk -h) (Supports soft-hardening)"
[ -d /data/other_vol ] && cecho " 3 Install to /data/other_vol, Free space: $(dir_avail /data/other_vol -h) (Supports soft-hardening)"
cecho " 4 Custom directory (Not recommended for beginners!)"
cecho " 0 Exit"
echo "-----------------------------------------------"
read -p "Enter number > " num
case "$num" in
1)
dir=/data
;;
2)
dir=/userdisk
;;
3)
dir=/data/other_vol
;;
4)
set_cust_dir
;;
*)
exit 1
;;
esac
}
set_asus_usb() {
while true; do
echo -e "Please select USB directory"
du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print " "NR" "$2" "$1}'
read -p "Enter number > " num
dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p)
if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then
echo -e "\033[31mDownload Master startup file not found: $dir/asusware.arm/etc/init.d/S50downloadmaster. Check settings!\033[0m"
sleep 1
else
break
fi
done
}
set_asus_dir() {
cecho "\033[33mAsus firmware detected, please select installation method\033[0m"
cecho " 1 Via USB + Download Master (Supports all firmware, ARM only, USB required)"
cecho " 2 Via startup script (Merlin firmware only)"
cecho " 0 Exit"
echo "-----------------------------------------------"
read -p "Enter number > " num
case "$num" in
1)
echo -e "Please install and enable Download Master in the router web UI first, then select the storage directory!"
sleep 2
set_asus_usb
;;
2)
cecho "If auto-start fails after reboot, please use USB + Download Master method instead!"
sleep 2
dir=/jffs
;;
*)
exit 1
;;
esac
}
set_cust_dir() {
while true; do
echo "-----------------------------------------------"
echo 'Path | Free Space:'
df -h | awk '{print $6,$4}' | sed 1d
echo 'Path must start with "/". Files in virtual memory (/tmp, /opt, /sys...) will be lost on reboot!!!'
read -p "Enter custom path > " dir
if [ "$(dir_avail "$dir")" = 0 ] || [ -n "$(echo "$dir" | grep -Eq '^/(tmp|opt|sys)(/|$)')" ]; then
cecho "\033[31mInvalid path! Please try again!\033[0m"
continue
fi
break 1
done
}
setdir() {
while true; do
echo "-----------------------------------------------"
cecho "\033[33mNote: ShellCrash requires at least 1MB of disk space\033[0m"
case "$systype" in
Padavan) dir=/etc/storage ;;
mi_snapshot) set_xiaomi_dir ;;
asusrouter) set_asus_dir ;;
ng_snapshot) dir=/tmp/mnt ;;
*)
cecho " 1 Install in \033[32m/etc\033[0m (Best for root users)"
cecho " 2 Install in \033[32m/usr/share\033[0m (Standard Linux systems)"
cecho " 3 Install in \033[32mUser Directory\033[0m (Best for non-root users)"
cecho " 4 Install on \033[32mExternal Storage\033[0m"
cecho " 5 Manual path entry"
cecho " 0 Exit"
echo "----------------------------------------------"
read -p "Enter number > " num
# Set Dir
case "$num" in
1)
dir=/etc
;;
2)
dir=/usr/share
;;
3)
dir=~/.local/share
mkdir -p ~/.config/systemd/user
;;
4)
set_usb_dir
;;
5)
set_cust_dir
;;
*)
echo "Installation cancelled"
exit 1
;;
esac
;;
esac
if [ ! -w "$dir" ]; then
cecho "\033[31mNo write permission for $dir! Please reset!\033[0m"
sleep 1
else
cecho "Target directory: \033[32m$dir\033[0m | Free space: $(dir_avail "$dir" -h)"
read -p "Confirm installation? (1/0) > " res
if [ "$res" = "1" ]; then
CRASHDIR="$dir"/ShellCrash
break
fi
fi
done
}
install() {
echo "-----------------------------------------------"
echo "Retrieving installation files from server..."
echo "-----------------------------------------------"
gettar
echo "-----------------------------------------------"
echo "ShellCrash installed successfully!"
[ "$profile" = "~/.bashrc" ] && echo "Please run [. ~/.bashrc > /dev/null] to update environment variables!"
[ -n "$(ls -l /bin/sh | grep -oE 'zsh')" ] && echo "Please run [. ~/.zshrc > /dev/null] to update environment variables!"
echo "-----------------------------------------------"
cecho "\033[33mType \033[30;47m $my_alias \033[0;33m to start management dashboard!!!\033[0m"
echo "-----------------------------------------------"
}
setversion() {
echo "-----------------------------------------------"
cecho "\033[33mSelect version to install:\033[0m"
cecho " 1 \033[32mBeta (Recommended)\033[0m"
cecho " 2 \033[36mStable\033[0m"
cecho " 3 \033[31mDev (Unstable)\033[0m"
echo "-----------------------------------------------"
read -p "Enter number > " num
case "$num" in
1) release_type=master ;;
2) release_type=stable ;;
3) release_type=dev ;;
*) ;;
esac
url=$(echo "$url" | sed "s/master/$release_type/")
}
# Pre-Install Checks
check_systype() {
[ -f "/etc/storage/started_script.sh" ] && {
systype=Padavan # Padavan Firmware
initdir='/etc/storage/started_script.sh'
}
[ -d "/jffs" ] && {
systype=asusrouter # Asus Firmware
[ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter'
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
}
[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot # Xiaomi device
[ -w "/var/mnt/cfg/firewall" ] && systype=ng_snapshot # NETGEAR device
}
check_user() {
if [ "$USER" != "root" ] && [ -z "$systype" ]; then
echo "Current User: $USER"
cecho "\033[31mPlease use the root user (do not use sudo directly!) to install!\033[0m"
echo "-----------------------------------------------"
read -p "Install anyway? Unknown errors may occur! (1/0) > " res
[ "$res" != "1" ] && exit 1
fi
}
check_version() {
echo "$url" | grep -q 'master' && setversion
webget /tmp/version "$url/version" echooff
[ "$result" = "200" ] && versionsh=$(cat /tmp/version)
rm -rf /tmp/version
# Output
cecho "Latest Version: \033[32m$versionsh\033[0m"
echo "-----------------------------------------------"
cecho "\033[44mFor issues, please join the TG group: \033[42;30m t.me/ShellClash \033[0m"
cecho "\033[37mSupports various OpenWrt-based router devices"
cecho "\033[33mSupports Debian, Centos and standard Linux systems\033[0m"
}
check_dir() {
if [ -n "$CRASHDIR" ]; then
echo "-----------------------------------------------"
cecho "Old installation detected at \033[36m$CRASHDIR\033[0m. Overwrite?"
cecho "\033[32mConfiguration files will NOT be removed during overwrite!\033[0m"
echo " 1 Overwrite Installation"
echo " 2 Uninstall old version and reinstall"
echo " 0 Cancel"
read -p "Enter number > " num
case "$num" in
1)
install
;;
2)
[ "$CRASHDIR" != "/" ] && rm -rf "$CRASHDIR"
echo "-----------------------------------------------"
cecho "\033[31mOld version uninstalled!\033[0m"
setdir
install
;;
9)
echo "Test Mode: Changing installation path $CRASHDIR"
setdir
install
;;
*)
cecho "\033[31mInstallation cancelled!\033[0m"
exit 1
;;
esac
else
setdir
install
fi
}
check_systype
check_user
check_version
check_dir

View File

@@ -1,25 +1,25 @@
#DustinWin-geosite全分组规则+去广告 #DustinWin-geosite全分组规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -39,15 +39,15 @@ rules:
- GEOSITE,apple-cn,🍎 苹果服务 - GEOSITE,apple-cn,🍎 苹果服务
- GEOSITE,google-cn,🇬 谷歌服务 - GEOSITE,google-cn,🇬 谷歌服务
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,games,🕹️ 游戏平台
- GEOSITE,media,🌍 国外媒体 - GEOSITE,media,🌍 国外媒体
- GEOSITE,games,🎮 游戏平台
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🌎 国外域名 - GEOSITE,proxy,🧱 代理域名
- GEOSITE,cn,🇨🇳 国内域名 - GEOSITE,cn,🛡️ 直连域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 国内 IP - GEOIP,cn,🀄️ 直连 IP
- GEOIP,telegram,📲 电报消息,no-resolve
- GEOIP,games,🕹️ 游戏平台
- GEOIP,media,🌍 国外媒体 - GEOIP,media,🌍 国外媒体
- GEOIP,games,🎮 游戏平台
- GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,22 +1,22 @@
#DustinWin-geosite全分组规则 #DustinWin-geosite全分组规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -35,15 +35,15 @@ rules:
- GEOSITE,apple-cn,🍎 苹果服务 - GEOSITE,apple-cn,🍎 苹果服务
- GEOSITE,google-cn,🇬 谷歌服务 - GEOSITE,google-cn,🇬 谷歌服务
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,games,🕹️ 游戏平台
- GEOSITE,media,🌍 国外媒体 - GEOSITE,media,🌍 国外媒体
- GEOSITE,games,🎮 游戏平台
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🌎 国外域名 - GEOSITE,proxy,🧱 代理域名
- GEOSITE,cn,🇨🇳 国内域名 - GEOSITE,cn,🛡️ 直连域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 国内 IP - GEOIP,cn,🀄️ 直连 IP
- GEOIP,telegram,📲 电报消息,no-resolve
- GEOIP,games,🕹️ 游戏平台
- GEOIP,media,🌍 国外媒体 - GEOIP,media,🌍 国外媒体
- GEOIP,games,🎮 游戏平台
- GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,12 +1,12 @@
#DustinWin-gesite轻量规则 #DustinWin-gesite轻量规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -20,9 +20,9 @@ proxy-groups:
rules: rules:
- GEOSITE,private,🔒 私有网络 - GEOSITE,private,🔒 私有网络
- GEOSITE,tld-proxy,🌎 国外域名 - GEOSITE,tld-proxy,🧱 代理域名
- GEOSITE,proxy,🌎 国外域名 - GEOSITE,proxy,🧱 代理域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 国内 IP - GEOIP,cn,🀄️ 直连 IP
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,23 +1,23 @@
#DustinWin-geosite标准规则+去广告 #DustinWin-geosite标准规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -39,9 +39,9 @@ rules:
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🌎 国外域名 - GEOSITE,proxy,🧱 代理域名
- GEOSITE,cn,🇨🇳 国内域名 - GEOSITE,cn,🛡️ 直连域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 国内 IP - GEOIP,cn,🀄️ 直连 IP
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,20 +1,20 @@
#DustinWin-geosite标准规则 #DustinWin-geosite标准规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -35,9 +35,9 @@ rules:
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🌎 国外域名 - GEOSITE,proxy,🧱 代理域名
- GEOSITE,cn,🇨🇳 国内域名 - GEOSITE,cn,🛡️ 直连域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 国内 IP - GEOIP,cn,🀄️ 直连 IP
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,27 +1,25 @@
#DustinWin-ruleset全分组规则+去广告 #DustinWin-ruleset全分组规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎥 奈飞视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📹 油管视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🎯 全球直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -34,20 +32,20 @@ proxy-groups:
- {name: 🇺🇸 美国节点, type: url-test, tolerance: 100, include-all: true, filter: "(?i)(🇺🇸|美|us|unitedstates|united states)"} - {name: 🇺🇸 美国节点, type: url-test, tolerance: 100, include-all: true, filter: "(?i)(🇺🇸|美|us|unitedstates|united states)"}
rule-providers: rule-providers:
ads:
type: http
behavior: domain
format: mrs
path: ./ruleset/ads.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ads.mrs"
interval: 86400
private: private:
type: http type: http
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs"
interval: 86400
ads:
type: http
behavior: domain
format: mrs
path: ./ruleset/ads.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ads.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -55,7 +53,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -63,7 +61,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -71,7 +69,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -79,7 +77,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -87,31 +85,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs"
interval: 86400
games:
type: http
behavior: domain
format: mrs
path: ./ruleset/games.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games.mrs"
interval: 86400
netflix:
type: http
behavior: domain
format: mrs
path: ./ruleset/netflix.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflix.mrs"
interval: 86400
youtube:
type: http
behavior: domain
format: mrs
path: ./ruleset/youtube.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/youtube.mrs"
interval: 86400 interval: 86400
media: media:
@@ -119,7 +93,15 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/media.mrs path: ./ruleset/media.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/media.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/media.mrs"
interval: 86400
games:
type: http
behavior: domain
format: mrs
path: ./ruleset/games.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -127,7 +109,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -135,7 +117,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -143,7 +125,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -151,7 +133,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -159,7 +141,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -167,31 +149,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs"
interval: 86400
telegramip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs"
interval: 86400
gamesip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/gamesip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/gamesip.mrs"
interval: 86400
netflixip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/netflixip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflixip.mrs"
interval: 86400 interval: 86400
mediaip: mediaip:
@@ -199,7 +157,23 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/mediaip.mrs path: ./ruleset/mediaip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/mediaip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/mediaip.mrs"
interval: 86400
gamesip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/gamesip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/gamesip.mrs"
interval: 86400
telegramip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -210,18 +184,15 @@ rules:
- RULE-SET,apple-cn,🍎 苹果服务 - RULE-SET,apple-cn,🍎 苹果服务
- RULE-SET,google-cn,🇬 谷歌服务 - RULE-SET,google-cn,🇬 谷歌服务
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,games,🕹️ 游戏平台
- RULE-SET,netflix,🎥 奈飞视频
- RULE-SET,youtube,📹 油管视频
- RULE-SET,media,🌍 国外媒体 - RULE-SET,media,🌍 国外媒体
- RULE-SET,games,🎮 游戏平台
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🌎 国外域名 - RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🇨🇳 国内域名 - RULE-SET,cn,🛡️ 直连域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 国内 IP - RULE-SET,cnip,🀄️ 直连 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve
- RULE-SET,gamesip,🕹️ 游戏平台
- RULE-SET,netflixip,🎥 奈飞视频
- RULE-SET,mediaip,🌍 国外媒体 - RULE-SET,mediaip,🌍 国外媒体
- MATCH,🐟 漏网之鱼 - RULE-SET,gamesip,🎮 游戏平台
- RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼

View File

@@ -1,24 +1,22 @@
#DustinWin-ruleset全分组规则 #DustinWin-ruleset全分组规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🎥 奈飞视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🎯 全球直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📹 油管视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -36,7 +34,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -44,7 +42,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -52,7 +50,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -60,7 +58,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -68,7 +66,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -76,31 +74,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs"
interval: 86400
games:
type: http
behavior: domain
format: mrs
path: ./ruleset/games.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games.mrs"
interval: 86400
netflix:
type: http
behavior: domain
format: mrs
path: ./ruleset/netflix.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflix.mrs"
interval: 86400
youtube:
type: http
behavior: domain
format: mrs
path: ./ruleset/youtube.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/youtube.mrs"
interval: 86400 interval: 86400
media: media:
@@ -108,7 +82,15 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/media.mrs path: ./ruleset/media.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/media.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/media.mrs"
interval: 86400
games:
type: http
behavior: domain
format: mrs
path: ./ruleset/games.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -116,7 +98,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -124,7 +106,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -132,7 +114,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -140,7 +122,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -148,7 +130,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -156,31 +138,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs"
interval: 86400
telegramip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs"
interval: 86400
gamesip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/gamesip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/gamesip.mrs"
interval: 86400
netflixip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/netflixip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflixip.mrs"
interval: 86400 interval: 86400
mediaip: mediaip:
@@ -188,7 +146,23 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/mediaip.mrs path: ./ruleset/mediaip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/mediaip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/mediaip.mrs"
interval: 86400
gamesip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/gamesip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/gamesip.mrs"
interval: 86400
telegramip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -198,18 +172,15 @@ rules:
- RULE-SET,apple-cn,🍎 苹果服务 - RULE-SET,apple-cn,🍎 苹果服务
- RULE-SET,google-cn,🇬 谷歌服务 - RULE-SET,google-cn,🇬 谷歌服务
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,games,🕹️ 游戏平台
- RULE-SET,netflix,🎥 奈飞视频
- RULE-SET,youtube,📹 油管视频
- RULE-SET,media,🌍 国外媒体 - RULE-SET,media,🌍 国外媒体
- RULE-SET,games,🎮 游戏平台
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🌎 国外域名 - RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🇨🇳 国内域名 - RULE-SET,cn,🛡️ 直连域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 国内 IP - RULE-SET,cnip,🀄️ 直连 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve
- RULE-SET,gamesip,🕹️ 游戏平台
- RULE-SET,netflixip,🎥 奈飞视频
- RULE-SET,mediaip,🌍 国外媒体 - RULE-SET,mediaip,🌍 国外媒体
- MATCH,🐟 漏网之鱼 - RULE-SET,gamesip,🎮 游戏平台
- RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼

View File

@@ -1,10 +1,10 @@
#DustinWin-ruleset轻量规则 #DustinWin-ruleset轻量规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT, 🚀 节点选择]} - {name: 🎯 全球直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, DIRECT]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, DIRECT]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -22,7 +22,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
private: private:
@@ -30,7 +30,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
tld-proxy: tld-proxy:
@@ -38,7 +38,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/tld-proxy.mrs path: ./ruleset/tld-proxy.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/tld-proxy.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/tld-proxy.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -46,7 +46,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -54,7 +54,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -62,7 +62,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -70,15 +70,15 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
- RULE-SET,private,DIRECT - RULE-SET,private,DIRECT
- RULE-SET,tld-proxy,🌎 国外域名 - RULE-SET,tld-proxy,🧱 代理域名
- RULE-SET,proxy,🌎 国外域名 - RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🎯 本地直连 - RULE-SET,cn,🎯 全球直连
- RULE-SET,privateip,DIRECT,no-resolve - RULE-SET,privateip,DIRECT,no-resolve
- RULE-SET,cnip,🎯 本地直连 - RULE-SET,cnip,🎯 全球直连
- RULE-SET,telegramip,📲 电报消息,no-resolve - RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,23 +1,23 @@
#DustinWin-ruleset标准规则+去广告 #DustinWin-ruleset标准规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -35,7 +35,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
ads: ads:
@@ -43,7 +43,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ads.mrs path: ./ruleset/ads.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ads.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ads.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -51,7 +51,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -59,7 +59,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -67,7 +67,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -75,7 +75,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -83,7 +83,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -91,7 +91,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -99,7 +99,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -107,7 +107,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -115,7 +115,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -123,7 +123,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -131,7 +131,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -139,7 +139,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -152,9 +152,9 @@ rules:
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🌎 国外域名 - RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🇨🇳 国内域名 - RULE-SET,cn,🛡️ 直连域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 国内 IP - RULE-SET,cnip,🀄️ 直连 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve - RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,20 +1,20 @@
#DustinWin-ruleset标准规则 #DustinWin-ruleset标准规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]} - {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]} - {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -32,7 +32,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -40,7 +40,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -48,7 +48,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -56,7 +56,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -64,7 +64,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -72,7 +72,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -80,7 +80,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -88,7 +88,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -96,7 +96,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -104,7 +104,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn-lite.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -112,7 +112,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -120,7 +120,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -128,7 +128,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -140,9 +140,9 @@ rules:
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🌎 国外域名 - RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🇨🇳 国内域名 - RULE-SET,cn,🛡️ 直连域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 国内 IP - RULE-SET,cnip,🀄️ 直连 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve - RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,7 +1,7 @@
#ShellCrash-geosite极简规则 #ShellCrash-geosite极简规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true} - {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT, 🚀 节点选择]} - {name: 🎯 全球直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
rules: rules:
- GEOIP,cn,🎯 本地直连 - GEOIP,cn,🎯 全球直连
- MATCH,🚀 节点选择 - MATCH,🚀 节点选择

View File

@@ -1,4 +1,4 @@
#ShellCrash-ruleset 全分组规则+去广告 For mihomo By Maozai 260111 #ShellCrash-ruleset 全分组规则+去广告 For mihomo By Maozai 260107
#此版本为Maozai根据ACL4SSR规则修改优化而来尽量在保持原有的基础上进行优化。 #此版本为Maozai根据ACL4SSR规则修改优化而来尽量在保持原有的基础上进行优化。
#数据源采用了DustinWin/ruleset_geodata和MetaCubeX/meta-rules-dat两个开源项目的规则感谢原作者的辛勤付出。 #数据源采用了DustinWin/ruleset_geodata和MetaCubeX/meta-rules-dat两个开源项目的规则感谢原作者的辛勤付出。
@@ -11,12 +11,12 @@ proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, ✨ 自动选择(去高倍率), 🛠️ 手动切换, ⚖️ 负载均衡, 🚑 故障转移, 🎯 本地直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, ✨ 自动选择(去高倍率), 🛠️ 手动切换, ⚖️ 负载均衡, 🚑 故障转移, 🎯 本地直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🛠️ 手动切换, type: select, include-all: true, proxies: [🎯 本地直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🛠️ 手动切换, type: select, include-all: true, proxies: [🎯 本地直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: ♻️ 自动选择, type: url-test, interval: 1800, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)"} - {name: ♻️ 自动选择, type: url-test, interval: 1800, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)"}
- {name: ✨ 自动选择(去高倍率), type: url-test, interval: 1800, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)`(?i)(专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|x([2-9]|\\d{2,}))"} - {name: ✨ 自动选择(去高倍率), type: url-test, interval: 1800, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www|专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|x([2-9]|\\d{2,}))"}
- {name: ⚖️ 负载均衡, type: load-balance, interval: 1800, include-all: true, hidden: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)"} - {name: ⚖️ 负载均衡, type: load-balance, interval: 1800, include-all: true, hidden: true}
- {name: 🚑 故障转移, type: fallback, interval: 1800, include-all: true, hidden: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)"} - {name: 🚑 故障转移, type: fallback, interval: 1800, include-all: true, hidden: true}
#
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🤖 AI节点过滤港澳, 🎯 本地直连, ♻️ 自动选择, 🛠️ 手动切换, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🤖 AI节点过滤港澳, 🎯 本地直连, ♻️ 自动选择, 🛠️ 手动切换, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI节点过滤港澳, type: url-test, interval: 3600, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)`(?i)(🇭🇰|港|🇲🇴|澳门|hk|hongkong|hong kong)", hidden: true} - {name: 🤖 AI节点过滤港澳, type: url-test, interval: 3600, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www|🇭🇰|港|🇲🇴|澳门|hk|hongkong|hong kong)", hidden: true}
- {name: 🎬 奈飞视频, type: select, proxies: [🚀 节点选择, 🎬 奈飞节点, 🎯 本地直连, ♻️ 自动选择, 🛠️ 手动切换, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🎬 奈飞视频, type: select, proxies: [🚀 节点选择, 🎬 奈飞节点, 🎯 本地直连, ♻️ 自动选择, 🛠️ 手动切换, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🎬 奈飞节点, type: url-test, interval: 1800, tolerance: 50, include-all: true, filter: "(?i)(NF|奈飞|解锁|Netflix|NETFLIX|Media)", hidden: true} - {name: 🎬 奈飞节点, type: url-test, interval: 1800, tolerance: 50, include-all: true, filter: "(?i)(NF|奈飞|解锁|Netflix|NETFLIX|Media)", hidden: true}
- {name: ▶️ 油管视频, type: select, proxies: [🚀 节点选择, 🎯 本地直连, ♻️ 自动选择, 🛠️ 手动切换, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: ▶️ 油管视频, type: select, proxies: [🚀 节点选择, 🎯 本地直连, ♻️ 自动选择, 🛠️ 手动切换, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
@@ -45,10 +45,10 @@ proxy-groups:
- {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 🇭🇰 香港节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇭🇰|港|hk|hongkong|hong kong)"} - {name: 🇭🇰 香港节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇭🇰|港|hk|hongkong|hong kong)"}
- {name: 🇹🇼 台湾节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇹🇼|台|tw|taiwan|tai wan)", exclude-filter: "(?i)(仙台)"} - {name: 🇹🇼 台湾节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇹🇼|台|tw|taiwan|tai wan)"}
- {name: 🇺🇸 美国节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇺🇸|美|洛杉矶|圣何塞|西雅图|纽约|波特兰|旧金山|休斯|达拉斯|硅谷|堪萨斯|迈阿密|凤凰城|芝加哥|奥勒姆|us|unitedstates|united states)", exclude-filter: "(?i)(南美|中美|拉美|亚美尼亚|美属)"} - {name: 🇺🇸 美国节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇺🇸|美|洛杉矶|圣何塞|西雅图|纽约|波特兰|旧金山|us|unitedstates|united states)"}
- {name: 🇯🇵 日本节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇯🇵|日|东京|大阪|埼玉|九州|仙台|jp|japan)", exclude-filter: "(?i)(尼日利亚|尼日尔|日内瓦)"} - {name: 🇯🇵 日本节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇯🇵|日|东京|大阪|埼玉|九州|jp|japan)"}
- {name: 🇪🇺 欧洲节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇪🇺|欧|德|英|法|荷|俄罗斯|西班牙|意大利|瑞士|瑞典|土耳其|挪威|芬兰|丹麦|比利时|爱尔兰|奥地利|波兰|葡萄牙|乌克兰|希腊|捷克|匈牙利|罗马尼亚|保加利亚|冰岛|克罗地亚|阿姆斯特丹)"} - {name: 🇪🇺 欧洲节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇪🇺|欧|德|英|法|荷|俄罗斯|西班牙|意大利|瑞士|瑞典|土耳其|挪威|芬兰|丹麦|比利时|爱尔兰|奥地利|波兰|葡萄牙|乌克兰|希腊|捷克|匈牙利|罗马尼亚|保加利亚|冰岛|克罗地亚)"}
- {name: 🇰🇷 韩国节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇰🇷|韩|韓|首尔|kr|kor)"} - {name: 🇰🇷 韩国节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇰🇷|韩|韓|首尔|kr|kor)"}
- {name: 🇸🇬 狮城节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇸🇬|新加坡|狮城|sg|singapore)"} - {name: 🇸🇬 狮城节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(🇸🇬|新加坡|狮城|sg|singapore)"}
@@ -221,8 +221,8 @@ rule-providers:
#规则顺序 #规则顺序
rules: rules:
- DOMAIN-SUFFIX,captive.apple.com,🍎 苹果服务 - DOMAIN-SUFFIX,captive.apple.com,DIRECT
- DOMAIN-SUFFIX,kamo.teracloud.jp,🀄️ 国内流量 - DOMAIN-SUFFIX,kamo.teracloud.jp,DIRECT
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,private,🔒 私有网络 - RULE-SET,private,🔒 私有网络

View File

@@ -1,31 +1,31 @@
#ShellCrash-ruleset极简规则 #ShellCrash-ruleset极简规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true} - {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT, 🚀 节点选择]} - {name: 🎯 全球直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
rule-providers: rule-providers:
cn: cn:
type: http type: http
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
type: http type: http
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
type: http type: http
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
rules: rules:
- RULE-SET,privateip,🎯 本地直连,no-resolve - RULE-SET,privateip,🎯 全球直连,no-resolve
- RULE-SET,cn,🎯 本地直连 - RULE-SET,cn,🎯 全球直连
- RULE-SET,cnip,🎯 本地直连 - RULE-SET,cnip,🎯 全球直连
- MATCH,🚀 节点选择 - MATCH,🚀 节点选择

View File

@@ -3,19 +3,17 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🕹️ 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎥 奈飞视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📹 油管视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🎮 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] }, { "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] },
@@ -41,32 +39,21 @@
{ "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" }, { "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" },
{ "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" }, { "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" },
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "games" ], "outbound": "🕹️ 游戏平台" },
{ "rule_set": [ "netflix" ], "outbound": "🎥 奈飞视频" },
{ "rule_set": [ "youtube" ], "outbound": "📹 油管视频" },
{ "rule_set": [ "media" ], "outbound": "🌍 国外媒体" }, { "rule_set": [ "media" ], "outbound": "🌍 国外媒体" },
{ "rule_set": [ "games" ], "outbound": "🎮 游戏平台" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" }, { "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" }, { "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" },
{ "ip_is_private": true, "outbound": "🎯 本地直连" }, { "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" }, { "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" },
{ "rule_set": [ "gamesip" ], "outbound": "🕹️ 游戏平台" }, { "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" },
{ "rule_set": [ "netflixip" ], "outbound": "🎥 奈飞视频" }, { "rule_set": [ "gamesip" ], "outbound": "🎮 游戏平台" }
{ "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" }
], ],
"rule_set": [ "rule_set": [
{
"tag": "ads",
"type": "remote",
"format": "binary",
"path": "./ruleset/ads.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "private", "tag": "private",
"type": "remote", "type": "remote",
@@ -75,6 +62,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "ads",
"type": "remote",
"format": "binary",
"path": "./ruleset/ads.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "trackerslist", "tag": "trackerslist",
"type": "remote", "type": "remote",
@@ -115,30 +110,6 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{
"tag": "netflix",
"type": "remote",
"format": "binary",
"path": "./ruleset/netflix.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/netflix.srs",
"download_detour": "DIRECT"
},
{
"tag": "youtube",
"type": "remote",
"format": "binary",
"path": "./ruleset/youtube.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/youtube.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "media", "tag": "media",
"type": "remote", "type": "remote",
@@ -147,6 +118,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "ai", "tag": "ai",
"type": "remote", "type": "remote",
@@ -180,11 +159,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "telegramip", "tag": "privateip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/telegramip.srs", "path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -195,6 +174,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "mediaip",
"type": "remote",
"format": "binary",
"path": "./ruleset/mediaip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "gamesip", "tag": "gamesip",
"type": "remote", "type": "remote",
@@ -204,19 +191,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "netflixip", "tag": "telegramip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/netflixip.srs", "path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/netflixip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
},
{
"tag": "mediaip",
"type": "remote",
"format": "binary",
"path": "./ruleset/mediaip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
} }
], ],

View File

@@ -3,19 +3,17 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🕹️ 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎥 奈飞视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📹 油管视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🎮 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🎯 本地直连", "type": "direct" }, { "tag": "🎯 本地直连", "type": "direct" },
@@ -38,22 +36,19 @@
{ "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" }, { "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" },
{ "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" }, { "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" },
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "games" ], "outbound": "🕹️ 游戏平台" },
{ "rule_set": [ "netflix" ], "outbound": "🎥 奈飞视频" },
{ "rule_set": [ "youtube" ], "outbound": "📹 油管视频" },
{ "rule_set": [ "media" ], "outbound": "🌍 国外媒体" }, { "rule_set": [ "media" ], "outbound": "🌍 国外媒体" },
{ "rule_set": [ "games" ], "outbound": "🎮 游戏平台" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" }, { "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" }, { "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" },
{ "ip_is_private": true, "outbound": "🎯 本地直连" }, { "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" }, { "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" },
{ "rule_set": [ "gamesip" ], "outbound": "🕹️ 游戏平台" }, { "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" },
{ "rule_set": [ "netflixip" ], "outbound": "🎥 奈飞视频" }, { "rule_set": [ "gamesip" ], "outbound": "🎮 游戏平台" }
{ "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" }
], ],
"rule_set": [ "rule_set": [
{ {
@@ -104,30 +99,6 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{
"tag": "netflix",
"type": "remote",
"format": "binary",
"path": "./ruleset/netflix.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/netflix.srs",
"download_detour": "DIRECT"
},
{
"tag": "youtube",
"type": "remote",
"format": "binary",
"path": "./ruleset/youtube.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/youtube.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "media", "tag": "media",
"type": "remote", "type": "remote",
@@ -136,6 +107,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "ai", "tag": "ai",
"type": "remote", "type": "remote",
@@ -169,11 +148,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "telegramip", "tag": "privateip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/telegramip.srs", "path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -184,6 +163,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "mediaip",
"type": "remote",
"format": "binary",
"path": "./ruleset/mediaip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "gamesip", "tag": "gamesip",
"type": "remote", "type": "remote",
@@ -193,19 +180,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "netflixip", "tag": "telegramip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/netflixip.srs", "path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/netflixip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
},
{
"tag": "mediaip",
"type": "remote",
"format": "binary",
"path": "./ruleset/mediaip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
} }
], ],

View File

@@ -2,7 +2,7 @@
{ {
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🎯 本地直连", "type": "direct" }, { "tag": "🎯 本地直连", "type": "direct" },
@@ -20,10 +20,10 @@
"route": { "route": {
"rules": [ "rules": [
{ "rule_set": [ "private" ], "outbound": "🎯 本地直连" }, { "rule_set": [ "private" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "tld-proxy" ], "outbound": "🌎 国外域名" }, { "rule_set": [ "tld-proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" }, { "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "cn" ], "outbound": "🎯 本地直连" }, { "rule_set": [ "cn" ], "outbound": "🎯 本地直连" },
{ "ip_is_private": true, "outbound": "🎯 本地直连" }, { "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
@@ -63,11 +63,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "telegramip", "tag": "privateip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/telegramip.srs", "path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -77,6 +77,14 @@
"path": "./ruleset/cnip.srs", "path": "./ruleset/cnip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -3,15 +3,15 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] }, { "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] },
@@ -39,23 +39,15 @@
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" }, { "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" }, { "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" },
{ "ip_is_private": true, "outbound": "🎯 本地直连" }, { "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" } { "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" }
], ],
"rule_set": [ "rule_set": [
{
"tag": "ads",
"type": "remote",
"format": "binary",
"path": "./ruleset/ads.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "private", "tag": "private",
"type": "remote", "type": "remote",
@@ -64,6 +56,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "ads",
"type": "remote",
"format": "binary",
"path": "./ruleset/ads.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "trackerslist", "tag": "trackerslist",
"type": "remote", "type": "remote",
@@ -137,11 +137,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "telegramip", "tag": "privateip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/telegramip.srs", "path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -151,6 +151,14 @@
"path": "./ruleset/cnip.srs", "path": "./ruleset/cnip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -3,15 +3,15 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🎯 本地直连", "type": "direct" }, { "tag": "🎯 本地直连", "type": "direct" },
@@ -36,13 +36,13 @@
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" }, { "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" }, { "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" },
{ "ip_is_private": true, "outbound": "🎯 本地直连" }, { "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" } { "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" }
], ],
"rule_set": [ "rule_set": [
@@ -127,11 +127,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "telegramip", "tag": "privateip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/telegramip.srs", "path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -141,6 +141,14 @@
"path": "./ruleset/cnip.srs", "path": "./ruleset/cnip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -1,4 +1,4 @@
//ShellCrash-ruleset 全分组规则+去广告 For Sing-box By Maozai 260111 //ShellCrash-ruleset 全分组规则+去广告 For Sing-box By Maozai 260107
{ {
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": ["♻️ 自动选择", "✨ 自动选择(去高倍率)", "🛠️ 手动切换", "🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": ["♻️ 自动选择", "✨ 自动选择(去高倍率)", "🛠️ 手动切换", "🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] },
@@ -28,18 +28,19 @@
{ "tag": "🀄️ 国内流量", "type": "selector", "outbounds": ["🎯 本地直连", "🚀 节点选择", "♻️ 自动选择", "🛠️ 手动切换", {providers_tags}] }, { "tag": "🀄️ 国内流量", "type": "selector", "outbounds": ["🎯 本地直连", "🚀 节点选择", "♻️ 自动选择", "🛠️ 手动切换", {providers_tags}] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": ["🚀 节点选择", "🎯 本地直连", "♻️ 自动选择", "🛠️ 手动切换", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": ["🚀 节点选择", "🎯 本地直连", "♻️ 自动选择", "🛠️ 手动切换", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] },
{ "tag": "🛑 广告拦截", "type": "selector", "outbounds": ["⛔ 禁止连接", "🔀 规则放行", "🎯 本地直连"] },
{ "tag": "🛑 广告拦截", "type": "selector", "outbounds": ["⛔ 禁止连接","🔀 规则放行", "🎯 本地直连"] },
{ "tag": "⛔ 禁止连接", "type": "block" }, { "tag": "⛔ 禁止连接", "type": "block" },
{ "tag": "🔀 规则放行", "type": "pass" }, { "tag": "🔀 规则放行", "type": "pass" },
{ "tag": "🎯 本地直连", "type": "direct" }, { "tag": "🎯 本地直连", "type": "direct" },
{ "tag": "GLOBAL", "type": "selector", "outbounds": ["🚀 节点选择", "🎯 本地直连"] }, { "tag": "GLOBAL", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "🇭🇰 香港节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇭🇰|港|hk|hongkong|hong kong)" }, { "tag": "🇭🇰 香港节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇭🇰|港|hk|hongkong|hong kong)" },
{ "tag": "🇹🇼 台湾节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇹🇼|台|tw|taiwan|tai wan)", "exclude": "(?i)(仙台)" }, { "tag": "🇹🇼 台湾节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇹🇼|台|tw|taiwan|tai wan)" },
{ "tag": "🇺🇸 美国节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇺🇸|美|洛杉矶|圣何塞|西雅图|纽约|波特兰|旧金山|休斯|达拉斯|硅谷|堪萨斯|迈阿密|凤凰城|芝加哥|奥勒姆|us|unitedstates|united states)", "exclude": "(?i)(南美|中美|拉美|亚美尼亚|美属)" }, { "tag": "🇺🇸 美国节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇺🇸|美|洛杉矶|圣何塞|西雅图|纽约|波特兰|旧金山|us|unitedstates|united states)" },
{ "tag": "🇯🇵 日本节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇯🇵|日|东京|大阪|埼玉|九州|jp|japan)", "exclude": "(?i)(尼日利亚|尼日尔|日内瓦)" }, { "tag": "🇯🇵 日本节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇯🇵|日|东京|大阪|埼玉|九州|jp|japan)" },
{ "tag": "🇪🇺 欧洲节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇪🇺|欧|德|英|法|荷|俄罗斯|西班牙|意大利|瑞士|瑞典|土耳其|挪威|芬兰|丹麦|比利时|爱尔兰|奥地利|波兰|葡萄牙|乌克兰|希腊|捷克|匈牙利|罗马尼亚|保加利亚|冰岛|克罗地亚|阿姆斯特丹)" }, { "tag": "🇪🇺 欧洲节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇪🇺|欧|德|英|法|荷|俄罗斯|西班牙|意大利|瑞士|瑞典|土耳其|挪威|芬兰|丹麦|比利时|爱尔兰|奥地利|波兰|葡萄牙|乌克兰|希腊|捷克|匈牙利|罗马尼亚|保加利亚|冰岛|克罗地亚)" },
{ "tag": "🇰🇷 韩国节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇰🇷|韩|韓|首尔|kr|kor)" }, { "tag": "🇰🇷 韩国节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇰🇷|韩|韓|首尔|kr|kor)" },
{ "tag": "🇸🇬 狮城节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇸🇬|新加坡|狮城|sg|singapore)" }, { "tag": "🇸🇬 狮城节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(🇸🇬|新加坡|狮城|sg|singapore)" },
@@ -48,9 +49,9 @@
], ],
"route": { "route": {
"rules": [ "rules": [
{ "domain_suffix": ["captive.apple.com"], "outbound": "🍎 苹果服务" }, { "domain_suffix": ["captive.apple.com"], "outbound": "DIRECT" },
{ "domain_suffix": ["kamo.teracloud.jp"], "outbound": "🀄️ 国内流量" }, { "domain_suffix": ["kamo.teracloud.jp"], "outbound": "DIRECT" },
{ "rule_set": ["private"], "outbound": "🎯 本地直连" }, { "rule_set": ["private"], "outbound": "🎯 本地直连" },
{ "rule_set": ["ads"], "outbound": "🛑 广告拦截" }, { "rule_set": ["ads"], "outbound": "🛑 广告拦截" },

View File

@@ -6,7 +6,7 @@
], ],
"route": { "route": {
"rules": [ "rules": [
{ "ip_is_private": true, "outbound": "🎯 本地直连" }, { "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "cn" ], "outbound": "🎯 本地直连" }, { "rule_set": [ "cn" ], "outbound": "🎯 本地直连" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
@@ -21,6 +21,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "privateip",
"type": "remote",
"format": "binary",
"path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "cnip", "tag": "cnip",
"type": "remote", "type": "remote",

View File

@@ -81,8 +81,11 @@ done
setconfig versionsh_l $version setconfig versionsh_l $version
#生成用于执行启动服务的变量文件 #生成用于执行启动服务的变量文件
[ ! -f "$CRASHDIR"/configs/command.env ] && { [ ! -f "$CRASHDIR"/configs/command.env ] && {
echo 'TMPDIR=/tmp/ShellCrash' > "$CRASHDIR"/configs/command.env TMPDIR='/tmp/ShellCrash'
echo "BINDIR=$CRASHDIR" >> "$CRASHDIR"/configs/command.env BINDIR="$CRASHDIR"
touch "$CRASHDIR"/configs/command.env
setconfig TMPDIR "$TMPDIR" "$CRASHDIR"/configs/command.env
setconfig BINDIR "$BINDIR" "$CRASHDIR"/configs/command.env
} }
if [ -n "$(grep 'crashcore=singbox' "$CFG_PATH")" ]; then if [ -n "$(grep 'crashcore=singbox' "$CFG_PATH")" ]; then
COMMAND='"$TMPDIR/CrashCore run -D $BINDIR -C $TMPDIR/jsons"' COMMAND='"$TMPDIR/CrashCore run -D $BINDIR -C $TMPDIR/jsons"'
@@ -97,10 +100,7 @@ grep -q 'firewall_mod' "$CRASHDIR/configs/ShellClash.cfg" 2>/dev/null || {
setconfig firewall_mod $firewall_mod setconfig firewall_mod $firewall_mod
} }
#设置更新地址 #设置更新地址
[ -n "$url" ] && setconfig update_url "$url" [ -n "$url" ] && setconfig update_url $url
[ -n "$release_type" ] && setconfig release_type "$release_type"
#设置语言
[ -n "$language" ] && echo "$language" > "$CRASHDIR/configs/i18n.cfg"
#设置环境变量 #设置环境变量
[ -w /opt/etc/profile ] && [ "$systype" = "Padavan" ] && profile=/opt/etc/profile [ -w /opt/etc/profile ] && [ "$systype" = "Padavan" ] && profile=/opt/etc/profile
[ -w /jffs/configs/profile.add ] && profile=/jffs/configs/profile.add [ -w /jffs/configs/profile.add ] && profile=/jffs/configs/profile.add
@@ -213,7 +213,7 @@ sed -i '/shellclash/d' /etc/group
rm -rf /etc/init.d/clash rm -rf /etc/init.d/clash
rm -rf "$CRASHDIR"/rules rm -rf "$CRASHDIR"/rules
[ "$systype" = "mi_snapshot" -a "$CRASHDIR" != '/data/clash' ] && rm -rf /data/clash [ "$systype" = "mi_snapshot" -a "$CRASHDIR" != '/data/clash' ] && rm -rf /data/clash
for file in webget.sh misnap_init.sh core.new configs/ShellCrash.cfg.bak; do for file in webget.sh misnap_init.sh core.new; do
rm -f "$CRASHDIR/$file" rm -f "$CRASHDIR/$file"
done done
#旧版变量改名 #旧版变量改名
@@ -222,13 +222,12 @@ sed -i "s/clash_v/core_v/g" "$CFG_PATH"
sed -i "s/clash.meta/meta/g" "$CFG_PATH" sed -i "s/clash.meta/meta/g" "$CFG_PATH"
sed -i "s/ShellClash/ShellCrash/g" "$CFG_PATH" sed -i "s/ShellClash/ShellCrash/g" "$CFG_PATH"
sed -i "s/cpucore=armv8/cpucore=arm64/g" "$CFG_PATH" sed -i "s/cpucore=armv8/cpucore=arm64/g" "$CFG_PATH"
sed -i "s/redir_mod=Redir模式/redir_mod=Redir/g" "$CFG_PATH" sed -i "s/redir_mod=Nft基础/redir_mod=Redir模式/g" "$CFG_PATH"
sed -i "s/redir_mod=Tproxy模式/redir_mod=Tproxy/g" "$CFG_PATH" sed -i "s/redir_mod=Nft混合/redir_mod=Tproxy模式/g" "$CFG_PATH"
sed -i "s/redir_mod=Tun模式/redir_mod=Tun/g" "$CFG_PATH" sed -i "s/redir_mod=Tproxy混合/redir_mod=Tproxy模式/g" "$CFG_PATH"
sed -i "s/redir_mod=混合模式/redir_mod=Mix/g" "$CFG_PATH"
sed -i "s/redir_mod=纯净模式/firewall_area=4/g" "$CFG_PATH" sed -i "s/redir_mod=纯净模式/firewall_area=4/g" "$CFG_PATH"
#变量统一使用ON/OFF #变量统一使用ON/OFF
sed -i 's/=\(已启用\|已开启\)$/=ON/' "$CFG_PATH" sed -i 's/=\(已启用\|已开启\)$/=ON/' "$CFG_PATH"
sed -i 's/=\(未启用\|未开启\)$/=OFF/' "$CFG_PATH" sed -i 's/=\(未启用\|未开启\)$/=OFF/' "$CFG_PATH"
printf '\033[32m脚本初始化完成,请输入\033[30;47m %s \033[0;33m命令开始使用\033[0m\n' "$my_alias" echo -e "\033[32m脚本初始化完成,请输入\033[30;47m $my_alias \033[0;33m命令开始使用\033[0m"

View File

@@ -1,10 +0,0 @@
# ===== 启动完成 =====
START_SERVICE_OK="服务已启动!"
START_WEB_HINT="管理面板:"
START_PAC_HINT="其他设备可使用 PAC 配置:"
START_PROXY_HINT="或使用 HTTP / SOCKS5 方式连接:"
# ===== 启动流程 =====
START_NO_CORE_CFG_TRY_GEN="没有找到核心配置文件,尝试生成 providers 配置文件!"
START_NO_CORE_CFG_IMPORT_FIRST="没有找到核心配置文件,请先导入配置文件!"
START_FIREWALL_DONE="已完成防火墙设置!"

View File

@@ -1,133 +0,0 @@
# =================================================
# Settings main menu
# =================================================
SET_MENU_TITLE="功能设置菜单"
SET_MENU_REDIR="路由模式设置:"
SET_MENU_DNS="DNS设置 "
SET_MENU_FW_FILTER="透明路由流量过滤"
SET_MENU_SKIP_CERT="跳过证书验证:"
SET_MENU_SNIFFER="启用域名嗅探:"
SET_MENU_ADV_PORT="自定义端口及密钥"
SET_MENU_IPV6="IPv6设置 "
SET_MENU_RESET="重置/备份/还原脚本设置"
SET_MENU_LANG="多语言切换"
SET_MENU_UI="UI切换"
# =================================================
# Main menu messages
# =================================================
SET_WARN_NONROOT="非root用户可能无法正确配置其他模式是否继续"
SET_SKIP_CERT_ON="已启用跳过本地证书验证!"
SET_SKIP_CERT_OFF="已禁用跳过本地证书验证!"
SET_SNIFFER_CORE_SWITCH="已自动切换至Meta内核域名嗅探需要"
SET_SNIFFER_LOCKED="当前内核与DNS模式组合下域名嗅探无法关闭"
SET_CORE_RUNNING="检测到服务正在运行,需要先停止服务!"
SET_CORE_STOP_CONFIRM="是否确认停止服务?"
# =================================================
# Backup / Restore / Reset
# =================================================
SET_BACKUP="备份脚本设置"
SET_RESTORE="还原脚本设置"
SET_RESET="重置脚本设置"
SET_BACKUP_OK="备份脚本设置成功!"
SET_BACKUP_FAIL="备份脚本设置失败!"
SET_RESTORE_OK="脚本设置已还原!(被覆盖配置已备份)"
SET_RESET_OK="重置脚本设置成功!(旧配置已备份)"
SET_RESET_FAIL="重置脚本设置失败!"
SET_BACKUP_MISS="未找到备份文件,请先备份!"
SET_NEED_RESTART="请重新启动脚本以生效!"
# =================================================
# Redir mode
# =================================================
SET_REDIR_DEFAULT="Redir模式"
SET_REDIR_CURRENT="当前路由模式为:"
SET_CORE_CURRENT="ShellCrash 核心为:"
SET_REDIR_RESTART_HINT="注意:切换模式后需要手动重启服务以生效!"
SET_REDIR_APPLIED="已设为"
SET_REDIR_REDIR="Redir模式"
SET_REDIR_MIX="Mix模式"
SET_REDIR_TPROXY="Tproxy模式"
SET_REDIR_TUN="Tun模式"
SET_REDIR_REDIRDES="Redir转发TCP不转发UDP"
SET_REDIR_MIXDES="Redir转发TCPTun转发UDP"
SET_REDIR_TPROXYDES="Tproxy转发TCP&UDP"
SET_REDIR_TUNDES="Tun转发TCP&UDP占用高不推荐"
SET_NO_MOD="设备未检测到内核模块:"
SET_NO_MOD2="请尝试其他模式或者安装相关依赖!"
XIAOMI_QOS="小米设备的 QoS 服务与当前模式冲突,是否禁用相关功能?"
# =================================================
# Firewall / VM
# =================================================
SET_FW_AREA="设置路由劫持范围"
SET_VM_REDIR="容器/虚拟机劫持"
SET_FW_SWITCH="切换防火墙应用"
SET_FW_AREA_DESC="仅局域网|仅本机|局域网+本机|纯净模式|旁路转发"
FW_AREA_NOTE_1="如你使用了第三方DNS如smartdns等"
FW_AREA_NOTE_2="请勿启用本机劫持或使用shellcrash用户执行"
FW_AREA_LAN="仅劫持局域网流量"
FW_AREA_LOCAL="仅劫持本机流量"
FW_AREA_BOTH="劫持局域网 + 本机流量"
FW_AREA_NONE="不配置流量劫持(纯净模式)"
FW_NO_NFTABLES="当前设备未安装 nftables或 nftables 版本过低(< 1.0.2),无法切换!"
FW_NO_IPTABLES="当前设备未安装 iptables无法切换"
FW_NO_FIREWALL_BACKEND="检测不到可用的防火墙应用iptables / nftables无法切换"
VM_DETECT_DESC="默认的容器/虚拟机网段为:"
VM_ENABLE_AUTO="启用劫持并使用自动检测的网段"
VM_ENABLE_MANUAL="启用劫持并手动指定网段"
VM_DISABLE="禁用劫持"
VM_INPUT_INFO="多个网段请用空格连接可使用【ip route】命令查看例如"
VM_INPUT_NET="请输入自定义网段"
VM_NO_NET_DETECTED="未检测到容器或虚拟机网段,请先运行容器后再运行脚本,或选择手动设置网段!"
VM_INPUT_DESC_1="多个网段请使用空格分隔可通过【ip route】命令查看"
VM_INPUT_DESC_2="例如:"
#inputport
INPUT_PORT="请输入端口号"
# =================================================
# Advanced config
# =================================================
ADV_HTTP_PORT="修改HTTP/SOCKS5端口"
ADV_HTTP_AUTH="设置HTTP/SOCKS5认证"
ADV_REDIR_PORT="修改Redir/Tproxy端口"
ADV_DNS_PORT="修改DNS监听端口"
ADV_PANEL_PORT="修改面板访问端口"
ADV_PANEL_PASS="设置面板访问密码"
ADV_PANEL_PASS_INPUT="请输入面板访问密码输入0删除"
ADV_HOST="自定义本机 Host 地址"
ADV_TABLE="自定义路由表"
# Advanced auth
ADV_AUTH_FORMAT_DESC="格式必须为 \033[32m用户名:密码\033[0m请使用英文冒号分隔"
ADV_AUTH_WARN="请尽量不要使用特殊符号,以避免产生未知错误!"
ADV_AUTH_REMOVE_HINT="输入 0 可删除认证信息"
ADV_AUTH_INPUT="请输入 HTTP / SOCKS5 用户名及密码"
ADV_AUTH_REMOVED="认证信息已移除!"
ADV_AUTH_ENV_CONFLICT="请先禁用本机劫持功能或使用增强模式!"
ADV_AUTH_INVALID="输入格式错误,请重新输入!"
# Host
ADV_HOST_WARN_LAN="如果你的局域网网段不是 192.168.x / 172.16.x / 10.x请务必修改"
ADV_HOST_WARN_CHANGE="设置后如本机 Host 地址发生变化,请务必重新修改!"
ADV_HOST_INPUT="请输入自定义 Host 地址(输入 0 移除)"
ADV_HOST_REMOVED="自定义 Host 地址已移除,请重新运行脚本以自动获取!"
ADV_HOST_INVALID="输入错误,请仔细核对!"
# Routing table
ADV_TABLE_WARN="仅当 Tproxy/Tun/混合模式 下路由表发生冲突时才需要设置!"
ADV_TABLE_INPUT="请输入路由表编号(不清楚请勿修改,建议 102-125"
# =================================================
# IPv6
# =================================================
IPV6_REDIR="IPv6透明路由劫持IPv6流量"
IPV6_DNS="IPv6-DNS解析是否返回IPv6地址"

View File

@@ -1,6 +0,0 @@
# 推荐任务配置
TASK_RECOM_TITLE="是否启用以下推荐的自动任务配置:"
TASK_RECOM_ITEM_1="运行时每10分钟自动保存面板配置"
TASK_RECOM_ITEM_2="服务启动后自动同步 NTP 时间"
TASK_RECOM_ITEM_3="在每日的3点0分重启服务"

View File

@@ -1,13 +0,0 @@
COMMON_INPUT="请输入对应数字"
COMMON_INPUT_L="请输入对应字母或数字"
COMMON_INPUT_R="是否启用?(1/0) > "
COMMON_BACK="返回上级菜单"
COMMON_SUCCESS="操作成功!"
COMMON_FAILED="操作失败!"
COMMON_UNSET="未设置"
COMMON_MOD="模式"
COMMON_ERR_NUM="请输入正确的数字!"
COMMON_ERR_LETTER="请输入正确的字母或数字!"
COMMON_ERR_INPUT="输入错误,请重新输入!"
COMMON_ERR_CANCEL="操作已取消!"

View File

@@ -1,52 +0,0 @@
#=====DNS主菜单=====
DNS_CURRENT_MODE="当前DNS运行模式为"
DNS_RESTART_NOTICE="切换模式后需要手动重启服务以生效!"
DNS_MODE_MIX_DESC="CN域名DIRECT-DNS其它fake-ip"
DNS_MODE_ROUTE_DESC="CN域名DIRECT-DNS其它PROXY-DNS"
DNS_MODE_REDIR_DESC="建议搭配加密/第三方DNS服务使用"
DNS_MENU_PROTECT="DNS防泄漏"
DNS_MENU_HOSTS="Hosts优化"
DNS_MENU_ECS="ECS优化"
DNS_MENU_REDIR="DNS劫持端口"
DNS_PROTECT_DESC="——启用时少量网站可能出现连接卡顿"
DNS_HOSTS_DESC="——调用本机hosts并劫持NTP服务"
DNS_ECS_DESC="——解决CDN下载浪费流量等问题"
DNS_REDIR_PORT_DESC="——用于兼容第三方DNS服务"
DNS_FAKEIP_MENU="管理Fake-IP过滤列表"
DNS_ADV_MENU="修改DNS服务器"
DNS_SET_OK="DNS模式已设置为"
DNS_CORE_UNSUPPORTED="当前内核不支持该功能!"
#=====DNS重定向=====
DNS_REDIR_WARN="仅限搭配第三方DNS服务AdGuard、SmartDNS等使用"
DNS_REDIR_HINT="建议第三方DNS上游指向"
DNS_REDIR_NO_SERVICE="该端口未检测到正在运行的DNS服务"
#=====Fake-IP=====
DNS_FAKEIP_DESC="用于解决Fake-IP模式下部分地址或应用无法连接的问题"
DNS_FAKEIP_TIP="脚本已内置大量地址,只需添加出现问题的地址"
DNS_FAKEIP_EXAMPLE="示例格式如下:\na.b.com\n*.b.com\n*.*.b.com"
DNS_FAKEIP_EXIST="已添加的Fake-IP过滤地址"
DNS_FAKEIP_EMPTY="当前尚未添加任何自定义Fake-IP过滤地址"
DNS_FAKEIP_EDIT="输入序号移除,输入地址添加"
#=====DNS高级=====
DNS_ADV_SPLIT="多个DNS地址请使用“|”或“,”分隔输入"
DNS_ADV_CERT="使用DoH/DoT需具备本地根证书文件"
DNS_ADV_SINGBOX_LIMIT="注意SingBox内核仅加载第一个DNS"
DNS_ADV_EDIT_DIRECT="修改DIRECT-DNS"
DNS_ADV_EDIT_PROXY="修改PROXY-DNS该DNS查询会经过节点"
DNS_ADV_EDIT_DEFAULT="修改DEFAULT-DNS必须是IP用于解析其他DNS"
DNS_ADV_AUTO_ENCRYPT="一键配置加密DNS"
DNS_ADV_RESET="重置默认DNS配置"
DNS_IPV6_NOT_SUPPORT="该选项暂不支持IPv6加密DNS"
DNS_ENCRYPT_OK="已设置加密DNS如遇DNS解析问题请重置DNS配置"
DNS_CORE_REQUIRE="请使用Mihomo或SingBox内核"

View File

@@ -1,83 +0,0 @@
# ===== 通用提示 =====
MENU_RESTART_NOTICE="检测到配置变更,是否立即重启服务以应用新配置?"
MENU_PORT_CONFLICT_TITLE="检测到端口被以下进程占用!内核可能无法正常启动!"
MENU_PORT_CONFLICT_HINT="请修改默认端口配置!"
MENU_CORE_LOADED_OK="内核加载完成!"
MENU_CORE_LOADED_BAD="检测到不可用的内核文件可能是文件受损或CPU架构不匹配"
MENU_CORE_REMOVED="内核文件已移除,请认真检查后重新上传!"
MENU_CFG_LOADED_OK="配置文件加载完成!"
MENU_OVERRIDE_WARN="你已经禁用了配置文件覆写功能,这会导致大量脚本功能无法使用!"
MENU_OVERRIDE_ASK="是否取消禁用?"
# ===== 欢迎与状态 =====
MENU_WELCOME="欢迎使用ShellCrash"
MENU_RUN_ON="正在运行"
MENU_RUN_SET="已设置"
MENU_RUN_OFF="没有运行"
MENU_PURE_MOD="纯净"
MENU_MOD="模式"
MENU_IP_DF="设备IP地址"
MENU_AUTOSTART_ON="已设置开机启动!"
MENU_AUTOSTART_OFF="未设置开机启动!"
MENU_AUTOSTART_DEBUG="并处于debug状态"
MENU_MEM_USED="当前内存占用:"
MENU_RUNNING_TIME="已运行:"
MENU_TG_CHANNEL="TG频道"
# ===== /tmp 文件检测 =====
MENU_TMP_CORE_FOUND="发现可用的内核文件:"
MENU_TMP_CORE_ASK="是否立即加载该内核(会停止当前服务)?"
MENU_TMP_CFG_FOUND="发现内核配置文件:"
MENU_TMP_CFG_ASK="是否立即加载为配置文件?"
MENU_MAIN_1="启动/重启服务"
MENU_MAIN_2="功能设置"
MENU_MAIN_3="停止服务"
MENU_MAIN_4="启动设置"
MENU_MAIN_5="自动任务"
MENU_MAIN_6="配置文件管理"
MENU_MAIN_7="访问与控制"
MENU_MAIN_8="工具与优化"
MENU_MAIN_9="更新与支持"
MENU_MAIN_0="退出脚本"
MENU_MAIN_PROMPT="请输入对应数字> "
# ===== 服务操作 =====
MENU_SERVICE_STOPPED="服务已停止!"
# ===== 测试 / 调试 =====
MENU_TEST_RUNNING_1="正在测试运行!"
MENU_TEST_RUNNING_2="如发现错误请截图后前往咨询:"
MENU_TEST_DONE_OK="测试完成!没有发现问题,请重新启动服务~"
MENU_TEST_DONE_FAIL="测试完成!"
MENU_TEST_LOG_HINT="完整执行记录请查看:"
MENU_ERROR_FOUND="发现错误:"
# ===== 命令行帮助 =====
MENU_CLI_TEST="测试模式"
MENU_CLI_HELP="帮助列表"
MENU_CLI_UNINSTALL="卸载脚本"
MENU_CLI_INIT="初始化脚本"
MENU_CLI_DEBUG="测试运行"
MENU_CLI_START="启动服务"
MENU_CLI_STOP="停止服务"
MENU_CLI_BOOT_INIT="开机初始化"
MENU_HELP_ONLINE="在线求助:"
MENU_HELP_BLOG="官方博客:"
MENU_HELP_GITHUB="发布页面:"

View File

@@ -1,14 +0,0 @@
# 新手引导
UG_WELCOME="欢迎使用新手引导!"
UG_CHOOSE_ENV="请先选择你的使用环境:"
UG_TIP_CONFIG="(你之后依然可以在设置中更改各种配置)"
UG_OPTION_1="路由设备配置局域网透明代理"
UG_OPTION_2="Linux设备仅配置本机代理"
UG_OPTION_3="还原之前备份的设置"
UG_RESTORE_OK="脚本设置已还原!请重新启动脚本!"
UG_IP_FORWARD_WARN="检测到你的设备尚未开启ip转发局域网设备将无法正常连接网络是否立即开启"
UG_ENABLE_LOW_MEM="检测到你的安装目录空间不足10M是否开启小闪存模式"
UG_IMPORT_CONFIG="这是运行前的最后一步"
UG_CONFIG_TIP="你必须拥有一份配置文件才能运行服务!"
UG_CONFIG_RES="是否立即导入配置文件?"
UG_FINAL_TIP="很好!现在只需要执行启动就可以愉快的使用了!"

View File

@@ -1,10 +0,0 @@
# ===== Startup =====
START_SERVICE_OK="Service started successfully!"
START_WEB_HINT="Dashboard:"
START_PAC_HINT="Other devices can connect using PAC configuration:"
START_PROXY_HINT="Or connect using HTTP / SOCKS5:"
# ===== Startup Flow =====
START_NO_CORE_CFG_TRY_GEN="Core configuration not found. Attempting to generate providers configuration!"
START_NO_CORE_CFG_IMPORT_FIRST="Core configuration not found. Please import a configuration first!"
START_FIREWALL_DONE="Firewall configuration completed!"

View File

@@ -1,128 +0,0 @@
# =================================================
# Settings main menu
# =================================================
SET_MENU_TITLE="Welcome to the Function Settings Menu:"
SET_MENU_REDIR="Routing Mode:"
SET_MENU_DNS="DNS Settings:"
SET_MENU_FW_FILTER="Transparent Routing Traffic Filter"
SET_MENU_SKIP_CERT="Skip Cert Verify:"
SET_MENU_SNIFFER="Enable Sniff:"
SET_MENU_ADV_PORT="Custom Ports and Secrets"
SET_MENU_IPV6="IPv6 Settings:"
SET_MENU_RESET="Reset / Backup / Restore Script Settings"
SET_MENU_LANG="Language"
SET_MENU_UI="UI Switch"
# =================================================
# Main menu messages
# =================================================
SET_WARN_NONROOT="Non-root users may not be able to configure some modes correctly. Continue anyway?"
SET_SKIP_CERT_ON="Skipping local certificate verification is now ENABLED!"
SET_SKIP_CERT_OFF="Skipping local certificate verification is now DISABLED!"
SET_SNIFFER_CORE_SWITCH="Automatically switched to Meta core (required for domain sniffing)"
SET_SNIFFER_LOCKED="Domain sniffing cannot be disabled with the current core and DNS mode combination!"
SET_CORE_RUNNING="Service is currently running and must be stopped first!"
SET_CORE_STOP_CONFIRM="Do you want to stop the service?"
# =================================================
# Backup / Restore / Reset
# =================================================
SET_BACKUP="Backup Script Settings"
SET_RESTORE="Restore Script Settings"
SET_RESET="Reset Script Settings"
SET_BACKUP_OK="Script settings have been backed up!"
SET_RESTORE_OK="Script settings have been restored! (Overwritten config has been backed up)"
SET_RESET_OK="Script settings have been reset! (Old config has been backed up)"
SET_BACKUP_MISS="Backup file not found. Please back up first!"
SET_NEED_RESTART="Please restart the script for changes to take effect!"
# =================================================
# Redir mode
# =================================================
SET_REDIR_DEFAULT="Redir Mode"
SET_REDIR_CURRENT="Current routing mode:"
SET_CORE_CURRENT="ShellCrash core:"
SET_REDIR_RESTART_HINT="You must manually restart the service for the change to take effect!"
SET_REDIR_APPLIED="Routing mode set to"
SET_REDIR_REDIR="Redir Mode"
SET_REDIR_MIX="Mix Mode"
SET_REDIR_TPROXY="Tproxy Mode"
SET_REDIR_TUN="Tun Mode"
SET_REDIR_REDIRDES="Redirect TCP traffic only (no UDP)"
SET_REDIR_MIXDES="Redirect TCP via Redir, UDP via Tun"
SET_REDIR_TPROXYDES="Tproxy forwards both TCP UDP"
SET_REDIR_TUNDES="Tun forwards both TCP UDP (high resource usage)"
SET_NO_MOD="The kernel module not detected"
SET_NO_MOD2="Please install required dependencies or select another mode!"
XIAOMI_QOS="Xiaomi QoS service conflicts with the current mode. Disable related features?"
# =================================================
# Firewall / VM
# =================================================
SET_FW_AREA="Set Routing Hijack Scope"
SET_VM_REDIR="Container / VM Hijacking"
SET_FW_SWITCH="Switch Firewall Backend"
SET_FW_AREA_DESC="LAN only|Local only|LAN&Local|Pure mode|Bypass:"
FW_AREA_NOTE="If you are using a third-party DNS like SmartDNS, \ndo not enable local hijacking or run the service as a ShellCrash user"
FW_AREA_LAN="Hijack LAN traffic only"
FW_AREA_LOCAL="Hijack local device traffic only"
FW_AREA_BOTH="Hijack both LAN and local device traffic"
FW_AREA_NONE="Do not hijack traffic (Pure mode)"
FW_NO_NFTABLES="nftables is not installed, or the version is too old (< 1.0.2). Unable to switch!"
FW_NO_IPTABLES="iptables is not installed. Unable to switch!"
FW_NO_FIREWALL_BACKEND="No available firewall backend detected (iptables / nftables). Unable to switch!"
VM_DETECT_DESC="Default Container/VM Subnet:"
VM_ENABLE_AUTO="Enable hijacking using automatically detected subnets"
VM_ENABLE_MANUAL="Enable hijacking and manually specify subnets"
VM_DISABLE="Disable hijacking"
VM_INPUT_INFO="Separate multiple segments with spaces. Check your configuration using ip route. Example:"
VM_INPUT_NET="Please enter cust subnets"
VM_NO_NET_DETECTED="No container or VM subnet detected. Please start the container first, or configure the subnet manually!"
VM_INPUT_DESC="Multiple subnets should be separated by spaces. You can check them using the 'ip route' command, for example:"
#inputport
INPUT_PORT="Input port"
# =================================================
# Advanced config
# =================================================
ADV_HTTP_PORT="Change HTTP / SOCKS5 Port"
ADV_HTTP_AUTH="Set HTTP / SOCKS5 Authentication"
ADV_REDIR_PORT="Change Redir / Tproxy Ports"
ADV_DNS_PORT="Change DNS Listening Port"
ADV_PANEL_PORT="Change Web Panel Port"
ADV_PANEL_PASS="Set Web Panel Password"
ADV_PANEL_PASS_INPUT="Enter web panel password (enter 0 to remove)"
ADV_HOST="Custom Local Host Address"
ADV_TABLE="Custom Routing Table"
# Advanced auth
ADV_AUTH_FORMAT_DESC="Format must be \033[32musername:password\033[0m, separated by a colon!"
ADV_AUTH_WARN="Avoid using special characters to prevent unexpected issues!"
ADV_AUTH_REMOVE_HINT="Enter 0 to remove authentication"
ADV_AUTH_INPUT="Please enter HTTP / SOCKS5 username and password"
ADV_AUTH_REMOVED="Authentication information has been removed!"
ADV_AUTH_ENV_CONFLICT="Please disable local hijacking or switch to enhanced mode first!"
ADV_AUTH_INVALID="Invalid input format. Please try again!"
# Host
ADV_HOST_WARN_LAN="If your LAN subnet is not 192.168.x / 172.16.x / 10.x, you must modify it!"
ADV_HOST_WARN_CHANGE="If the local host address changes after setting, please update it again!"
ADV_HOST_INPUT="Please enter a custom host address (enter 0 to remove)"
ADV_HOST_REMOVED="Custom host address removed. Please rerun the script to auto-detect!"
ADV_HOST_INVALID="Invalid input. Please check carefully!"
# Routing table
ADV_TABLE_WARN="Only required when routing table conflicts occur in Tproxy, Tun, or Mixed mode!"
ADV_TABLE_INPUT="Please enter the routing table ID (do not modify unless necessary, recommended 102-125)"
# =================================================
# IPv6
# =================================================
IPV6_REDIR="IPv6 Transparent Routing (Hijack IPv6 Traffic)"
IPV6_DNS="IPv6 DNS Resolution (Return IPv6 addresses)"

View File

@@ -1,6 +0,0 @@
# Recommended task configuration
TASK_RECOM_TITLE="Enable the following recommended automatic tasks?"
TASK_RECOM_ITEM_1="Save Dashboard select every 10 minutes"
TASK_RECOM_ITEM_2="Synchronize NTP after service startup"
TASK_RECOM_ITEM_3="Daily service restart at 03:00"

View File

@@ -1,13 +0,0 @@
COMMON_INPUT="Please enter a number"
COMMON_INPUT_L="Enter a letter or a number"
COMMON_INPUT_R="Enable? (1/0) > "
COMMON_BACK="Back"
COMMON_SUCCESS="Setup Success!"
COMMON_FAILED="Setup failed!"
COMMON_UNSET="Not set"
COMMON_MOD="Mod"
COMMON_ERR_NUM="Please enter a valid number!"
COMMON_ERR_LETTER="Please enter a valid letter or number!"
COMMON_ERR_INPUT="Invalid input, please try again!"
COMMON_ERR_CANCEL="Operation cancelled!"

View File

@@ -1,54 +0,0 @@
#===== DNS Main Menu =====
DNS_CURRENT_MODE="Current DNS running mode:"
DNS_RESTART_NOTICE="Changes require a manual service restart to take effect."
DNS_MODE_MIX_DESC="CN domains use DIRECT-DNS, others use fake-ip"
DNS_MODE_ROUTE_DESC="CN domains use DIRECT-DNS, others use PROXY-DNS"
DNS_MODE_REDIR_DESC="All domains use DIRECT-DNS"
DNS_MENU_PROTECT="DNS Leak Protect"
DNS_MENU_HOSTS="Hosts Optimization"
DNS_MENU_ECS="ECS Optimization"
DNS_MENU_REDIR="DNS Redirect Port"
DNS_PROTECT_DESC="May cause slow connections on some websites when enabled"
DNS_HOSTS_DESC="Use local hosts file and hijack NTP service"
DNS_ECS_DESC="Reduce wasted traffic caused by CDN misrouting"
DNS_REDIR_PORT_DESC="Used for compatibility with third-party DNS services"
DNS_FAKEIP_MENU="Manage Fake-IP Filter List"
DNS_ADV_MENU="Configure DNS Servers"
DNS_SET_OK="DNS mode has been set to"
DNS_CORE_UNSUPPORTED="The current core does not support this feature."
#===== DNS Redirect =====
DNS_REDIR_WARN="For use with third-party DNS services only (AdGuard, SmartDNS, etc.)"
DNS_REDIR_HINT="It is recommended to set the upstream DNS of the third-party service to"
DNS_REDIR_INPUT="Enter the listening port of the third-party DNS service (0 to reset)>"
DNS_REDIR_NO_SERVICE="No running DNS service detected on this port!"
#===== Fake-IP =====
DNS_FAKEIP_DESC="Used to resolve connectivity issues for certain addresses or applications in Fake-IP mode"
DNS_FAKEIP_TIP="The script already includes many built-in entries. Only add problematic addresses."
DNS_FAKEIP_EXAMPLE="Examples:\na.b.com\n*.b.com\n*.*.b.com"
DNS_FAKEIP_EXIST="Existing Fake-IP filter entries:"
DNS_FAKEIP_EMPTY="No Fake-IP filter entries have been added"
DNS_FAKEIP_EDIT="Enter a number to remove an entry, or enter an address to add one"
#===== Advanced DNS =====
DNS_ADV_SPLIT="Use '|' or ',' to separate multiple DNS addresses"
DNS_ADV_CERT="DoH/DoT requires a local root certificate file"
DNS_ADV_SINGBOX_LIMIT="Note: SingBox core only loads the first DNS entry"
DNS_ADV_EDIT_DIRECT="Edit DIRECT-DNS"
DNS_ADV_EDIT_PROXY="Edit PROXY-DNS (queries go through the proxy)"
DNS_ADV_EDIT_DEFAULT="Edit DEFAULT-DNS (must be an IP, used to resolve other DNS servers)"
DNS_ADV_AUTO_ENCRYPT="Auto-configure Encrypted DNS"
DNS_ADV_RESET="Reset to default DNS configuration"
DNS_INPUT_NEW="Enter new DNS address>"
DNS_IPV6_NOT_SUPPORT="This option does not support IPv6 encrypted DNS!"
DNS_ENCRYPT_OK="Encrypted DNS has been configured. If DNS issues occur, please reset DNS settings."
DNS_CORE_REQUIRE="Please use the Mihomo or SingBox core"

View File

@@ -1,83 +0,0 @@
# ===== Common Prompts =====
MENU_RESTART_NOTICE="Changes have been detected. Please restart the service!"
MENU_PORT_CONFLICT_TITLE="The port is occupied by the following process. The core may fail to start!"
MENU_PORT_CONFLICT_HINT="Please modify the default port configuration!"
MENU_CORE_LOADED_OK="Core loaded successfully!"
MENU_CORE_LOADED_BAD="The core file is invalid. It may be corrupted or incompatible with the CPU architecture!"
MENU_CORE_REMOVED="The core file has been removed. Please verify and upload it again!"
MENU_CFG_LOADED_OK="Configuration file loaded successfully!"
MENU_OVERRIDE_WARN="You have disabled configuration overwrite. This will cause many features to be unavailable!"
MENU_OVERRIDE_ASK="Cancel the disable setting?"
# ===== Welcome & Status =====
MENU_WELCOME="Welcome to ShellCrash!"
MENU_RUN_ON=" Running"
MENU_RUN_SET="Configured"
MENU_RUN_OFF="Stopped"
MENU_PURE_MOD="Pure"
MENU_MOD=" Mod"
MENU_IP_DF="Device IP Address"
MENU_AUTOSTART_ON="Autostart enable!"
MENU_AUTOSTART_OFF="Autostart disable!"
MENU_AUTOSTART_DEBUG="Debug mode!"
MENU_MEM_USED="Memory usage: "
MENU_RUNNING_TIME="Running time: "
MENU_TG_CHANNEL="Telegram Channel: "
# ===== /tmp File Detection =====
MENU_TMP_CORE_FOUND="Available core file found:"
MENU_TMP_CORE_ASK="Load this core file? (The current service will be stopped)"
MENU_TMP_CFG_FOUND="Kernel configuration file found:"
MENU_TMP_CFG_ASK="Load as the configuration file? (1/0) > "
# ===== Main Menu =====
MENU_MAIN_1="Start / Restart Service"
MENU_MAIN_2="Feature Settings"
MENU_MAIN_3="Stop Service"
MENU_MAIN_4="Startup Settings"
MENU_MAIN_5="Scheduled Tasks"
MENU_MAIN_6="Configuration Management"
MENU_MAIN_7="Access & Control"
MENU_MAIN_8="Tools & Optimization"
MENU_MAIN_9="Updates & Support"
MENU_MAIN_0="Exit Script"
MENU_MAIN_PROMPT="Please enter a number > "
# ===== Service Operations =====
MENU_SERVICE_STOPPED="Service has been stopped!"
# ===== Test / Debug =====
MENU_TEST_RUNNING="Running test mode. If errors occur, please take a screenshot and seek assistance."
MENU_TEST_DONE_OK="Test completed! No issues found. Please restart the service."
MENU_TEST_DONE_FAIL="Test completed!"
MENU_TEST_LOG_HINT="Full execution log can be found at:"
MENU_ERROR_FOUND="Error found:"
# ===== Command Line Help =====
MENU_CLI_TEST="Test Mode"
MENU_CLI_HELP="Help List"
MENU_CLI_UNINSTALL="Uninstall Script"
MENU_CLI_INIT="Initialize Script"
MENU_CLI_DEBUG="Debug Mode"
MENU_CLI_START="Start Service"
MENU_CLI_STOP="Stop Service"
MENU_CLI_BOOT_INIT="Boot Initialization"
MENU_HELP_ONLINE="Online Support:"
MENU_HELP_BLOG="Official Blog:"
MENU_HELP_GITHUB="Release Page:"

View File

@@ -1,14 +0,0 @@
UG_WELCOME="Welcome to User Guide!"
UG_CHOOSE_ENV="Please select your usage environment:"
UG_TIP_CONFIG="(You can still change various settings later)"
UG_OPTION_1="Router: LAN transparent proxy"
UG_OPTION_2="Linux device: local proxy only"
UG_OPTION_3="Restore previous backup settings"
UG_RESTORE_OK="Script settings have been restored! Please restart the script!"
UG_IP_FORWARD_WARN="Your device has not enabled IP forwarding, LAN devices will not connect properly. Enable now?"
UG_ENABLE_LOW_MEM="Your installation directory is less than 10MB, enable low-flash mode?"
UG_IMPORT_CONFIG="Import configuration file? (Last step before running)"
UG_CONFIG_TIP="You must have a configuration file to run the service!"
UG_CONFIG_RES="Importing now? "
UG_FINAL_TIP="Great! Now just start the service to enjoy!"

View File

@@ -1,8 +0,0 @@
load_lang() {
i18n=$(cat "$CRASHDIR"/configs/i18n.cfg 2>/dev/null)
[ -z "$i18n" ] && i18n=chs
file="$CRASHDIR/lang/$i18n/$1.lang"
[ -s "$file" ] && . "$file"
}

View File

@@ -1,7 +1,3 @@
[ -n "$__IS_LIB_LOGGER" ] && return
__IS_LIB_LOGGER=1
#日志工具 #日志工具
. "$CRASHDIR"/libs/web_json.sh . "$CRASHDIR"/libs/web_json.sh
#$1日志内容$2显示颜色$3是否推送$4是否覆盖上一条 #$1日志内容$2显示颜色$3是否推送$4是否覆盖上一条

View File

@@ -2,7 +2,7 @@
webget(){ webget(){
if pidof CrashCore >/dev/null; then if pidof CrashCore >/dev/null; then
setproxy #设置临时代理,【$1】代表下载目录【$2】代表在线地址 setproxy #设置临时代理
url=$(printf '%s\n' "$2" | url=$(printf '%s\n' "$2" |
sed -e 's#https://.*jsdelivr.net/gh/juewuy/ShellCrash[@|/]#https://raw.githubusercontent.com/juewuy/ShellCrash/#' \ sed -e 's#https://.*jsdelivr.net/gh/juewuy/ShellCrash[@|/]#https://raw.githubusercontent.com/juewuy/ShellCrash/#' \
-e 's#https://gh.jwsc.eu.org/#https://raw.githubusercontent.com/juewuy/ShellCrash/#') -e 's#https://gh.jwsc.eu.org/#https://raw.githubusercontent.com/juewuy/ShellCrash/#')
@@ -10,8 +10,6 @@ webget(){
url=$(printf '%s\n' "$2" | url=$(printf '%s\n' "$2" |
sed 's#https://raw.githubusercontent.com/juewuy/ShellCrash/#https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@#') sed 's#https://raw.githubusercontent.com/juewuy/ShellCrash/#https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@#')
fi fi
# ===============================================
#参数【$1】代表下载目录【$2】代表在线地址 #参数【$1】代表下载目录【$2】代表在线地址
#参数【$3】代表输出显示【$4】不启用重定向 #参数【$3】代表输出显示【$4】不启用重定向
#参数【$5】代表验证证书【$6】使用自定义UA #参数【$5】代表验证证书【$6】使用自定义UA
@@ -28,41 +26,23 @@ webget(){
wget -Y off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2" wget -Y off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2"
return $? return $?
elif curl --version >/dev/null 2>&1; then elif curl --version >/dev/null 2>&1; then
if [ "$3" = "echooff" ];then [ "$3" = "echooff" ] && progress='-s' || progress='-#'
progress='-s'
elif echo "$url" | grep -q 'jsdelivr.net';then
progress='-#'
. "$CRASHDIR"/libs/web_get_curlbar.sh && curl_fsize
else
progress='-#'
fi
[ "$4" = "rediroff" ] && redirect='' || redirect='-L' [ "$4" = "rediroff" ] && redirect='' || redirect='-L'
if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then
certificate='' certificate=''
else else
certificate='-k' certificate='-k'
fi fi
# curl 特殊版本兼容
auth_arg=""
if curl --version | grep -q '^curl 8.' && ckcmd base64; then if curl --version | grep -q '^curl 8.' && ckcmd base64; then
auth_b64=$(printf '%s' "$authentication" | base64) auth_b64=$(printf '%s' "$authentication" | base64)
[ -n "$auth_b64" ] && auth_arg="--proxy-header Proxy-Authorization:Basic $auth_b64" result=$(curl $agent -w '%{http_code}' --connect-timeout 3 --proxy-header "Proxy-Authorization: Basic $auth_b64" $progress $redirect $certificate -o "$1" "$url")
fi
if [ -n "$fsize_raw" ] && [ "$fsize_raw" -gt 204800 ]; then
result=$(execute_curl "$1" "$url" "$fsize_raw" "$agent $auth_arg $redirect $certificate")
else else
result=$(curl $agent $auth_arg -w '%{http_code}' --connect-timeout 3 $progress $redirect $certificate -o "$1" "$url") result=$(curl $agent -w '%{http_code}' --connect-timeout 3 $progress $redirect $certificate -o "$1" "$url")
fi fi
[ "$result" = "200" ] && return 0 #成功则退出否则重试 [ "$result" = "200" ] && return 0 #成功则退出否则重试
export https_proxy="" export https_proxy=""
export http_proxy="" export http_proxy=""
result=$(curl $agent -w '%{http_code}' --connect-timeout 5 $progress $redirect $certificate -o "$1" "$2")
if [ -n "$fsize_raw" ] && [ "$fsize_raw" -gt 204800 ]; then
result=$(execute_curl "$1" "$2" "$fsize_raw" "$agent $redirect $certificate")
else
result=$(curl $agent -w '%{http_code}' --connect-timeout 5 $progress $redirect $certificate -o "$1" "$2")
fi
[ "$result" = "200" ] [ "$result" = "200" ]
return $? return $?
elif ckcmd wget;then elif ckcmd wget;then
@@ -74,4 +54,4 @@ webget(){
echo "No Curl or Wget" echo "No Curl or Wget"
return 1 return 1
fi fi
} }

View File

@@ -1,47 +0,0 @@
bar_max=42 #进度条长度
curl_fsize(){ # 获取文件大小
fsize_raw=0
header=$(curl -sIL --connect-timeout 2 "$url")
# 代理容错
[ -z "$header" ] && { export https_proxy=""; export http_proxy=""; header=$(curl -sIL --connect-timeout 2 "$url"); }
# 提取大小 (优先 Content-Length其次 ETag)
fsize_raw=$(echo "$header" | grep -i 'Content-Length' | tail -n 1 | awk '{print $2}' | tr -d '\r' | awk '{print int($1)}')
if [ -z "$fsize_raw" ] || [ "$fsize_raw" -eq 0 ]; then
etag=$(echo "$header" | grep -i 'etag' | tail -n 1 | cut -d '"' -f2 | cut -d '-' -f1)
[ -n "$etag" ] && fsize_raw=$(printf "%d" 0x$etag 2>/dev/null)
fi
}
execute_curl(){ # 手搓curl进度条
local path="$1" target_url="$2" total_size="$3" extra_args="$4"
rm -f /tmp/webget_res
# 后台静默下载,状态码写入临时文件
curl $extra_args -s -L -w '%{http_code}' "$target_url" -o "$path" > /tmp/webget_res &
local pid=$!
# 循环监控
while kill -0 $pid 2>/dev/null; do
if [ -f "$path" ]; then
local curr=$(wc -c < "$path")
local pct=$(awk -v c=$curr -v t=$total_size 'BEGIN {p=(c*100/t); if(p>100)p=100; printf "%.1f", p}')
local num=$(awk -v p=$pct -v w=$bar_max 'BEGIN {printf "%d", p*w/100}')
local bar=$(printf "%${num}s" | tr ' ' '#'); local spc_n=$((bar_max - num))
local spc=""; [ "$spc_n" -gt 0 ] && spc=$(printf "%${spc_n}s")
local size=$(( fsize_raw * 100 / 1048576 ))
local fs="$((size / 100)).$((size % 100)) MB"
printf "\r\033[2K%s%s %6s%%(%s)" "$bar" "$spc" "$pct" "$fs" >&2
fi
usleep 200000 2>/dev/null || sleep 1
done
local code=$(cat /tmp/webget_res 2>/dev/null)
if [ "$code" = "200" ] || [ "$code" = "206" ]; then
local full=$(printf "%${bar_max}s" | tr ' ' '#')
printf "\r\033[2K%s 100.0%%(%s)\n" "$full" "$fs" >&2
else
printf "\r\033[2K" >&2; [ -f "$path" ] && rm -f "$path"
fi
echo "$code"
}

View File

@@ -2,345 +2,300 @@
# Copyright (C) Juewuy # Copyright (C) Juewuy
CRASHDIR=$( CRASHDIR=$(
cd $(dirname $0) cd $(dirname $0)
pwd pwd
) )
CFG_PATH="$CRASHDIR"/configs/ShellCrash.cfg CFG_PATH="$CRASHDIR"/configs/ShellCrash.cfg
#加载执行目录,失败则初始化
# 加载执行目录,失败则初始化
. "$CRASHDIR"/libs/get_config.sh . "$CRASHDIR"/libs/get_config.sh
[ -z "$BINDIR" -o -z "$TMPDIR" -o -z "$COMMAND" ] && . "$CRASHDIR"/init.sh >/dev/null 2>&1 [ -z "$BINDIR" -o -z "$TMPDIR" -o -z "$COMMAND" ] && . "$CRASHDIR"/init.sh >/dev/null 2>&1
[ ! -f "$TMPDIR" ] && mkdir -p "$TMPDIR" [ ! -f "$TMPDIR" ] && mkdir -p "$TMPDIR"
# 通用工具 #通用工具
. "$CRASHDIR"/libs/set_config.sh . "$CRASHDIR"/libs/set_config.sh
. "$CRASHDIR"/libs/check_cmd.sh . "$CRASHDIR"/libs/check_cmd.sh
. "$CRASHDIR"/libs/check_autostart.sh . "$CRASHDIR"/libs/check_autostart.sh
. "$CRASHDIR"/libs/i18n.sh
. "$CRASHDIR"/menus/common.sh
. "$CRASHDIR"/menus/1_start.sh . "$CRASHDIR"/menus/1_start.sh
. "$CRASHDIR"/menus/running_status.sh . "$CRASHDIR"/menus/running_status.sh
errornum() {
# 加载Tui界面 echo "-----------------------------------------------"
[ -z "$tui_type" ] && tui_type='tui_layout' echo -e "\033[31m请输入正确的字母或数字\033[0m"
[ "$1" = '-l' ] && tui_type='tui_lite' }
. "$CRASHDIR"/menus/"$tui_type".sh
# 加载语言
load_lang common
load_lang menu
checkrestart() { checkrestart() {
comp_box "\033[32m$MENU_RESTART_NOTICE\033[0m" echo "-----------------------------------------------"
btm_box "1) 立即重启" \ echo -e "\033[32m检测到已变更的内容请重启服务\033[0m"
"0) 暂不重启" echo "-----------------------------------------------"
read -r -p "$COMMON_INPUT> " res read -p "是否现在重启服务?(1/0) > " res
if [ "$res" = 1 ]; then [ "$res" = 1 ] && start_service
start_service
fi
} }
# 检查端口冲突 checkport() { #检查端口冲突
checkport() { for portx in $dns_port $mix_port $redir_port $((redir_port + 1)) $db_port; do
while true; do if [ -n "$(netstat -ntul 2>&1 | grep ':$portx ')" ]; then
# Before each round of checks begins, execute netstat only once and cache the results echo "-----------------------------------------------"
# Avoid calling the system command once for each port echo -e "检测到端口【$portx】被以下进程占用!内核可能无法正常启动!\033[33m"
current_listening=$(netstat -ntul 2>&1) echo $(netstat -ntul | grep :$portx | head -n 1)
echo -e "\033[0m-----------------------------------------------"
conflict_found=0 echo -e "\033[36m请修改默认端口配置\033[0m"
. "$CRASHDIR"/menus/2_settings.sh && set_adv_config
for portx in $dns_port $mix_port $redir_port $((redir_port + 1)) $db_port; do . "$CRASHDIR"/libs/get_config.sh
# Use `grep` to search within the cached variables instead of re-running `netstat` checkport
conflict_line=$(echo "$current_listening" | grep ":$portx ") fi
done
if [ -n "$conflict_line" ]; then
comp_box "$portx】:$MENU_PORT_CONFLICT_TITLE" \
"\033[0m$(echo "$conflict_line" | head -n 1)\033[0m" \
"\033[36m$MENU_PORT_CONFLICT_HINT\033[0m"
. "$CRASHDIR"/menus/2_settings.sh && set_adv_config
. "$CRASHDIR"/libs/get_config.sh
# Mark conflict and exit the for loop, triggering the while loop to restart the check
# This replaces the original recursive call to `checkport`
conflict_found=1
break
fi
done
# If no conflicts are found after the entire for loop completes,
# the while loop exits and the function terminates.
if [ "$conflict_found" -eq 0 ]; then
break
fi
done
} }
ckstatus() { #脚本启动前检查
# 脚本启动前检查 versionsh=$(cat "$CRASHDIR"/version)
ckstatus() { [ -n "$versionsh" ] && versionsh_l=$versionsh
versionsh=$(cat "$CRASHDIR"/version) [ -z "$redir_mod" ] && redir_mod=纯净模式
[ -n "$versionsh" ] && versionsh_l=$versionsh #获取本机host地址
[ -z "$redir_mod" ] && redir_mod="$MENU_PURE_MOD" [ -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 'lan' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
# 获取本机host地址 [ -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=$(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地址'
[ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'lan' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) #dashboard目录位置
[ -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) if [ -f /www/clash/index.html ]; then
[ -z "$host" ] && host='$MENU_IP_DF' dbdir=/www/clash
hostdir=/clash
# dashboard目录位置 else
if [ -f /www/clash/index.html ]; then dbdir="$CRASHDIR"/ui
dbdir=/www/clash hostdir=":$db_port/ui"
hostdir=/clash fi
else #开机自启检测
dbdir="$CRASHDIR"/ui if check_autostart; then
hostdir=":$db_port/ui" auto="\033[32m已设置开机启动\033[0m"
fi auto1="\033[36m禁用\033[0mShellCrash开机启动"
else
if check_autostart; then auto="\033[31m未设置开机启动\033[0m"
auto="\033[32m$MENU_AUTOSTART_ON\033[0m" auto1="\033[36m允许\033[0mShellCrash开机启动"
else fi
auto="\033[31m$MENU_AUTOSTART_OFF\033[0m" #获取运行状态
fi PID=$(pidof CrashCore | awk '{print $NF}')
if [ -n "$PID" ]; then
PID=$(pidof CrashCore | awk '{print $NF}') run="\033[32m正在运行$redir_mod\033[0m"
if [ -n "$PID" ]; then running_status
run="\033[32m$MENU_RUN_ON$redir_mod$MENU_MOD\033[0m" elif [ "$firewall_area" = 5 ] && [ -n "$(ip route list table 100)" ]; then
running_status run="\033[32m已设置$redir_mod\033[0m"
elif [ "$firewall_area" = 5 ] && [ -n "$(ip route list table 100)" ]; then else
run="\033[32m$MENU_RUN_SET$redir_mod$MENU_MOD\033[0m" run="\033[31m没有运行$redir_mod\033[0m"
else #检测系统端口占用
run="\033[31m$MENU_RUN_OFF$redir_mod$MENU_MOD\033[0m" checkport
# 检测系统端口占用 fi
checkport corename=$(echo $crashcore | sed 's/singboxr/SingBoxR/' | sed 's/singbox/SingBox/' | sed 's/clash/Clash/' | sed 's/meta/Mihomo/')
fi [ "$firewall_area" = 5 ] && corename='转发'
corename=$(echo $crashcore | sed 's/singboxr/SingBoxR/' | sed 's/singbox/SingBox/' | sed 's/clash/Clash/' | sed 's/meta/Mihomo/') [ -f "$TMPDIR"/debug.log -o -f "$CRASHDIR"/debug.log -a -n "$PID" ] && auto="\033[33m并处于debug状态\033[0m"
# [ "$firewall_area" = 5 ] && corename='转发' #输出状态
[ -f "$TMPDIR"/debug.log -o -f "$CRASHDIR"/debug.log -a -n "$PID" ] && auto="\033[33m$MENU_AUTOSTART_DEBUG\033[0m" echo "-----------------------------------------------"
echo -e "\033[30;46m欢迎使用ShellCrash\033[0m 版本:$versionsh_l"
# 检查新手引导 echo -e "$corename服务$run$auto"
if [ -z "$userguide" ]; then if [ -n "$PID" ]; then
userguide=1 echo -e "当前内存占用:\033[44m"$VmRSS"\033[0m已运行\033[46;30m"$day"\033[44;37m"$time"\033[0m"
. "$CRASHDIR"/menus/userguide.sh && userguide fi
setconfig userguide 1 echo -e "TG频道\033[36;4mhttps://t.me/ShellClash\033[0m"
echo "-----------------------------------------------"
#检查新手引导
if [ -z "$userguide" ]; then
userguide=1
setconfig userguide 1
. "$CRASHDIR"/menus/8_tools.sh && userguide
. "$CRASHDIR"/configs/ShellCrash.cfg . "$CRASHDIR"/configs/ShellCrash.cfg
fi fi
#检查执行权限
# 检查执行权限 [ ! -x "$CRASHDIR"/start.sh ] && chmod +x "$CRASHDIR"/start.sh
[ ! -x "$CRASHDIR"/start.sh ] && chmod +x "$CRASHDIR"/start.sh #检查/tmp内核文件
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box'); do
# 检查/tmp内核文件 echo -e "发现可用的内核文件: \033[36m/tmp/$file\033[0m "
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box'); do read -p "是否加载(会停止当前服务)(1/0) > " res
comp_box "$MENU_TMP_CORE_FOUND \033[36m/tmp/$file\033[0m" \ [ "$res" = 1 ] && {
"$MENU_TMP_CORE_ASK"
btm_box "1) 立即加载" \
"0) 暂不加载"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && {
zip_type=$(echo "$file" | grep -oE 'tar.gz$|upx$|gz$') zip_type=$(echo "$file" | grep -oE 'tar.gz$|upx$|gz$')
. "$CRASHDIR"/menus/9_upgrade.sh && setcoretype . "$CRASHDIR"/menus/9_upgrade.sh && setcoretype
. "$CRASHDIR"/libs/core_tools.sh && core_check "/tmp/$file" . "$CRASHDIR"/libs/core_tools.sh && core_check "/tmp/$file"
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
msg_alert "\033[32m$MENU_CORE_LOADED_OK\033[0m" echo -e "\033[32m内核加载完成!\033[0m "
switch_core switch_core
else else
rm -rf /tmp/"$file" echo -e "\033[33m检测到不可用的内核文件可能是文件受损或CPU架构不匹配\033[0m"
msg_alert "\033[33m$MENU_CORE_LOADED_BAD\033[0m" \ rm -rf /tmp/"$file"
"\033[33m$MENU_CORE_REMOVED\033[0m" echo -e "\033[33m内核文件已移除请认真检查后重新上传\033[0m"
fi fi
} sleep 1
done }
echo "-----------------------------------------------"
# 检查/tmp配置文件 done
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -iE 'config.yaml$|config.yml$|config.json$'); do #检查/tmp配置文件
tmp_file=/tmp/$file for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -iE 'config.yaml$|config.yml$|config.json$'); do
comp_box "$MENU_TMP_CFG_FOUND\033[36m/tmp/$file\033[0m" \ tmp_file=/tmp/$file
"$MENU_TMP_CFG_ASK" echo -e "发现内核配置文件: \033[36m/tmp/$file\033[0m "
btm_box "1) 立即加载" \ read -p "是否加载为$crashcore的配置文件(1/0) > " res
"0) 暂不加载" [ "$res" = 1 ] && {
read -p "$COMMON_INPUT> " res if [ -n "$(echo /tmp/$file | grep -iE '.json$')" ]; then
[ "$res" = 1 ] && { mv -f /tmp/$file "$CRASHDIR"/jsons/config.json
if [ -n "$(echo /tmp/$file | grep -iE '.json$')" ]; then else
mv -f /tmp/$file "$CRASHDIR"/jsons/config.json mv -f /tmp/$file "$CRASHDIR"/yamls/config.yaml
else fi
mv -f /tmp/$file "$CRASHDIR"/yamls/config.yaml echo -e "\033[32m配置文件加载完成\033[0m "
fi sleep 1
msg_alert "\033[32m$MENU_CFG_LOADED_OK\033[0m " }
} done
done #检查禁用配置覆写
[ "$disoverride" = "1" ] && {
# 检查禁用配置覆写 echo -e "\033[33m你已经禁用配置文件覆写功能,这会导致大量脚本功能无法使用!\033[0m "
[ "$disoverride" = "1" ] && { read -p "是否取消禁用?(1/0) > " res
comp_box "\033[33m$MENU_OVERRIDE_WARN\033[0m" \ [ "$res" = 1 ] && unset disoverride && setconfig disoverride
"$MENU_OVERRIDE_ASK" echo "-----------------------------------------------"
btm_box "1) 是" \ }
"0) 否"
read -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && unset disoverride && setconfig disoverride
}
top_box "\033[30;43m$MENU_WELCOME\033[0m\t\t Ver: $versionsh_l" \
"$MENU_TG_CHANNEL\033[36;4mhttps://t.me/ShellClash\033[0m"
separator_line "-"
content_line "$corename$run\t $auto"
if [ -n "$PID" ]; then
content_line "$MENU_MEM_USED\033[44m$VmRSS\033[0m\t $MENU_RUNNING_TIME\033[46;30m$day\033[44;37m$time\033[0m"
fi
separator_line "="
} }
#主菜单
main_menu() { main_menu() {
while true; do #############################
ckstatus ckstatus
#############################
echo -e " 1 \033[32m启动/重启服务\033[0m"
echo -e " 2 \033[36m功能设置\033[0m"
echo -e " 3 \033[31m停止服务\033[0m"
echo -e " 4 \033[33m启动设置\033[0m"
echo -e " 5 设置\033[32m自动任务\033[0m"
echo -e " 6 管理\033[36m配置文件\033[0m"
echo -e " 7 \033[33m访问与控制\033[0m"
echo -e " 8 \033[0m工具与优化\033[0m"
echo -e " 9 \033[32m更新与支持\033[0m"
echo "-----------------------------------------------"
echo -e " 0 \033[0m退出脚本\033[0m"
read -p "请输入对应数字 > " num
btm_box "1) \033[32m$MENU_MAIN_1\033[0m"\ case "$num" in
"2) \033[36m$MENU_MAIN_2\033[0m"\ 0)
"3) \033[31m$MENU_MAIN_3\033[0m"\ exit
"4) \033[33m$MENU_MAIN_4\033[0m"\ ;;
"5) \033[32m$MENU_MAIN_5\033[0m"\ 1)
"6) \033[36m$MENU_MAIN_6\033[0m"\ start_service
"7) \033[33m$MENU_MAIN_7\033[0m"\ exit
"8) $MENU_MAIN_8"\ ;;
"9) \033[32m$MENU_MAIN_9\033[0m"\ 2)
""\ checkcfg=$(cat "$CFG_PATH")
"0) $MENU_MAIN_0" . "$CRASHDIR"/menus/2_settings.sh && settings
read -r -p "$MENU_MAIN_PROMPT" num if [ -n "$PID" ]; then
checkcfg_new=$(cat "$CFG_PATH")
case "$num" in [ "$checkcfg" != "$checkcfg_new" ] && checkrestart
"" | 0) fi
line_break main_menu
exit 0 ;;
;; 3)
1) [ "$bot_tg_service" = ON ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
start_service "$CRASHDIR"/start.sh stop
line_break sleep 1
exit echo "-----------------------------------------------"
;; echo -e "\033[31m$corename服务已停止\033[0m"
2) main_menu
checkcfg=$(cat "$CFG_PATH") ;;
. "$CRASHDIR"/menus/2_settings.sh && settings 4)
if [ -n "$PID" ]; then . "$CRASHDIR"/menus/4_setboot.sh && setboot
checkcfg_new=$(cat "$CFG_PATH") main_menu
[ "$checkcfg" != "$checkcfg_new" ] && checkrestart ;;
fi 5)
;; . "$CRASHDIR"/menus/5_task.sh && task_menu
3) main_menu
[ "$bot_tg_service" = ON ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop ;;
"$CRASHDIR"/start.sh stop 6)
sleep 1 . "$CRASHDIR"/menus/6_core_config.sh && set_core_config
msg_alert "\033[31m$corename$MENU_SERVICE_STOPPED\033[0m" main_menu
;; ;;
4) 7)
. "$CRASHDIR"/menus/4_setboot.sh && setboot GT_CFG_PATH="$CRASHDIR"/configs/gateway.cfg
;; touch "$GT_CFG_PATH"
5) checkcfg=$(cat "$CFG_PATH" "$GT_CFG_PATH")
. "$CRASHDIR"/menus/5_task.sh && task_menu . "$CRASHDIR"/menus/7_gateway.sh && gateway
;; if [ -n "$PID" ]; then
6) checkcfg_new=$(cat "$CFG_PATH" "$GT_CFG_PATH")
. "$CRASHDIR"/menus/6_core_config.sh && set_core_config [ "$checkcfg" != "$checkcfg_new" ] && checkrestart
;; fi
7) main_menu
GT_CFG_PATH="$CRASHDIR"/configs/gateway.cfg ;;
touch "$GT_CFG_PATH" 8)
checkcfg=$(cat "$CFG_PATH" "$GT_CFG_PATH") . "$CRASHDIR"/menus/8_tools.sh && tools
. "$CRASHDIR"/menus/7_gateway.sh && gateway main_menu
if [ -n "$PID" ]; then ;;
checkcfg_new=$(cat "$CFG_PATH" "$GT_CFG_PATH") 9)
[ "$checkcfg" != "$checkcfg_new" ] && checkrestart checkcfg=$(cat "$CFG_PATH")
fi . "$CRASHDIR"/menus/9_upgrade.sh && upgrade
;; if [ -n "$PID" ]; then
8) checkcfg_new=$(cat "$CFG_PATH")
. "$CRASHDIR"/menus/8_tools.sh && tools [ "$checkcfg" != "$checkcfg_new" ] && checkrestart
;; fi
9) main_menu
checkcfg=$(cat "$CFG_PATH") ;;
. "$CRASHDIR"/menus/9_upgrade.sh && upgrade *)
if [ -n "$PID" ]; then errornum
checkcfg_new=$(cat "$CFG_PATH") exit
[ "$checkcfg" != "$checkcfg_new" ] && checkrestart ;;
fi esac
;;
*)
errornum
;;
esac
done
} }
case "$1" in case "$1" in
"") "")
main_menu main_menu
;; ;;
-l) -t)
main_menu shtype=sh
;; ckcmd bash && shtype=bash
-t) $shtype -x "$CRASHDIR"/menu.sh
shtype=sh ;;
[ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash -s)
"$shtype" -x "$CRASHDIR"/menu.sh -l "$CRASHDIR"/start.sh "$2" "$3" "$4" "$5" "$6"
;; ;;
-s) -i)
"$CRASHDIR"/start.sh "$2" "$3" "$4" "$5" "$6" . "$CRASHDIR"/init.sh 2>/dev/null
;; ;;
-i) -st)
. "$CRASHDIR"/init.sh 2>/dev/null shtype=sh
;; ckcmd bash && shtype=bash
-st) "$shtype" -x "$CRASHDIR"/starts/bfstart.sh
shtype=sh . "$CRASHDIR"/starts/start_legacy.sh
ckcmd bash && shtype=bash start_legacy "$COMMAND" 'shellcrash'
"$shtype" -x "$CRASHDIR"/starts/bfstart.sh "$shtype" -x "$CRASHDIR"/starts/afstart.sh
. "$CRASHDIR"/starts/start_legacy.sh "$CRASHDIR"/start.sh stop
start_legacy "$COMMAND" 'shellcrash' ;;
"$shtype" -x "$CRASHDIR"/starts/afstart.sh -d)
"$CRASHDIR"/start.sh stop shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash
;; echo -e "正在测试运行!如发现错误请截图后前往\033[32;4mt.me/ShellClash\033[0m咨询"
-d) $shtype "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log
shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash $shtype -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log
comp_box "$MENU_TEST_RUNNING_1" \ echo -----------------------------------------
"$MENU_TEST_RUNNING_2\033[36;4mhttps://t.me/ShellClash\033[0m" cat "$TMPDIR"/debug_sh_bug.log | grep 'start\.sh' >"$TMPDIR"/sh_bug
"$shtype" "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log if [ -s "$TMPDIR"/sh_bug ]; then
"$shtype" -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log while read line; do
cat "$TMPDIR"/debug_sh_bug.log | grep 'start\.sh' >"$TMPDIR"/sh_bug echo -e "发现错误:\033[33;4m$line\033[0m"
if [ -s "$TMPDIR"/sh_bug ]; then grep -A 1 -B 3 "$line" "$TMPDIR"/debug_sh.log
line_break echo -----------------------------------------
echo "===========================================================" done <"$TMPDIR"/sh_bug
while read line; do rm -rf "$TMPDIR"/sh_bug
echo -e "$MENU_ERROR_FOUND\033[33;4m$line\033[0m" echo -e "\033[32m测试完成\033[0m完整执行记录请查看\033[36m$TMPDIR/debug_sh.log\033[0m"
grep -A 1 -B 3 "$line" "$TMPDIR"/debug_sh.log else
echo echo -e "\033[32m测试完成没有发现问题请重新启动服务~\033[0m"
done <"$TMPDIR"/sh_bug rm -rf "$TMPDIR"/debug_sh.log
echo "===========================================================" fi
rm -rf "$TMPDIR"/sh_bug "$CRASHDIR"/start.sh stop
comp_box "\033[32m$MENU_TEST_DONE_FAIL\033[0m" \ ;;
"$MENU_TEST_LOG_HINT\033[36m$TMPDIR/debug_sh.log\033[0m" -u)
else . "$CRASHDIR"/menus/uninstall.sh && uninstall
rm -rf "$TMPDIR"/debug_sh.log ;;
comp_box "\033[32m$MENU_TEST_DONE_OK\033[0m" *)
line_break echo -----------------------------------------
fi echo "欢迎使用ShellCrash"
"$CRASHDIR"/start.sh stop echo -----------------------------------------
;; echo " -t 测试模式"
-u) echo " -h 帮助列表"
. "$CRASHDIR"/menus/uninstall.sh && uninstall echo " -u 卸载脚本"
;; echo " -i 初始化脚本"
*) echo " -d 测试运行"
comp_box "$MENU_WELCOME" echo -----------------------------------------
content_line "-t $MENU_CLI_TEST" echo " crash -s start 启动服务"
content_line "-h $MENU_CLI_HELP" echo " crash -s stop 停止服务"
content_line "-u $MENU_CLI_UNINSTALL" echo " $CRASHDIR/start.sh init 开机初始化"
content_line "-i $MENU_CLI_INIT" echo -----------------------------------------
content_line "-d $MENU_CLI_DEBUG" echo "在线求助t.me/ShellClash"
separator_line "-" echo "官方博客juewuy.github.io"
content_line "crash -s start $MENU_CLI_START" echo "发布页面github.com/juewuy/ShellCrash"
content_line "crash -s stop $MENU_CLI_STOP" echo -----------------------------------------
content_line "$CRASHDIR/start.sh init $MENU_CLI_BOOT_INIT" ;;
separator_line "-"
content_line "$MENU_HELP_ONLINE\033[36mhttps://t.me/ShellClash\033[0m"
content_line "$MENU_HELP_BLOG\033[36mhttps://juewuy.github.io\033[0m"
content_line "$MENU_HELP_GITHUB\033[36mhttps://github.com/juewuy/ShellCrash\033[0m"
separator_line "="
line_break
;;
esac esac

View File

@@ -3,65 +3,49 @@
[ -n "$__IS_MODULE_1_START_LOADED" ] && return [ -n "$__IS_MODULE_1_START_LOADED" ] && return
__IS_MODULE_1_START_LOADED=1 __IS_MODULE_1_START_LOADED=1
load_lang 1_start
# ===== 启动完成提示 ===== #启动相关
startover() { startover() {
top_box "\033[32m$START_SERVICE_OK\033[0m" \ echo -ne " \r"
"$START_WEB_HINT \033[4;36mhttp://$host$hostdir\033[0m" echo -e "\033[32m服务已启动\033[0m"
if [ "$firewall_area" = 4 ]; then echo -e "请使用 \033[4;36mhttp://$host$hostdir\033[0m 管理内置规则"
content_line "" if [ "$redir_mod" = "纯净模式" ]; then
content_line "$START_PAC_HINT \033[4;32mhttp://$host:$db_port/ui/pac\033[0m" echo "-----------------------------------------------"
content_line "$START_PROXY_HINT IP{\033[36m$host\033[0m} Port{\033[36m$mix_port\033[0m}" echo -e "其他设备可以使用PAC配置连接\033[4;32mhttp://$host:$db_port/ui/pac\033[0m"
echo -e "或者使用HTTP/SOCK5方式连接IP{\033[36m$host\033[0m}端口{\033[36m$mix_port\033[0m}"
fi fi
separator_line "="
line_break
sleep 1
return 0 return 0
} }
# ===== 启动核心 =====
start_core() { start_core() {
if echo "$crashcore" | grep -q 'singbox'; then if echo "$crashcore" | grep -q 'singbox'; then
core_config="$CRASHDIR/jsons/config.json" core_config="$CRASHDIR"/jsons/config.json
else else
core_config="$CRASHDIR/yamls/config.yaml" core_config="$CRASHDIR"/yamls/config.yaml
fi fi
echo "-----------------------------------------------"
if [ ! -s "$core_config" ] && [ -s "$CRASHDIR/configs/providers.cfg" ]; then if [ ! -s $core_config -a -s "$CRASHDIR"/configs/providers.cfg ]; then
if [ "$crashcore" = singboxr ]; then echo -e "\033[33m没有找到${crashcore}配置文件尝试生成providers配置文件\033[0m"
CORE_TYPE=singbox [ "$crashcore" = singboxr ] && coretype=singbox
else [ "$crashcore" = meta -o "$crashcore" = clashpre ] && coretype=clash
CORE_TYPE=clash . "$CRASHDIR"/menus/6_core_config.sh && gen_${coretype}_providers
fi elif [ -s $core_config -o -n "$Url" -o -n "$Https" ]; then
. "$CRASHDIR/menus/providers_$CORE_TYPE.sh" && gen_providers "$CRASHDIR"/start.sh start
#设置循环检测以判定服务启动是否成功
comp_box "\033[33m$START_NO_CORE_CFG_TRY_GEN\033[0m" . "$CRASHDIR"/libs/start_wait.sh
elif [ -s "$core_config" ] || [ -n "$Url" ] || [ -n "$Https" ]; then [ -n "$test" -o -n "$(pidof CrashCore)" ] && {
"$CRASHDIR/start.sh" start #启动TG机器人
[ "$bot_tg_service" = ON ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_start
# 循环检测服务启动状态 startover
. "$CRASHDIR/libs/start_wait.sh" }
[ -n "$test" ] || pidof CrashCore >/dev/null && {
# 启动 TG 机器人
if [ "$bot_tg_service" = ON ]; then
. "$CRASHDIR/menus/bot_tg_service.sh" && bot_tg_start
fi
startover
}
else else
comp_box "\033[31m$START_NO_CORE_CFG_IMPORT_FIRST\033[0m" echo -e "\033[31m没有找到${crashcore}配置文件,请先导入配置文件!\033[0m"
. "$CRASHDIR/menus/6_core_config.sh" && set_core_config . "$CRASHDIR"/menus/6_core_config.sh && set_core_config
fi fi
} }
# ===== 启动服务入口 =====
start_service() { start_service() {
if [ "$firewall_area" = 5 ]; then if [ "$firewall_area" = 5 ]; then
"$CRASHDIR/start.sh" start "$CRASHDIR"/start.sh start
comp_box "\033[32m$START_FIREWALL_DONE\033[0m" echo -e "\033[32m已完成防火墙设置!\033[0m"
line_break
else else
start_core start_core
fi fi

File diff suppressed because it is too large Load Diff

View File

@@ -5,10 +5,7 @@
__IS_MODULE_4_SETBOOT_LOADED=1 __IS_MODULE_4_SETBOOT_LOADED=1
allow_autostart() { allow_autostart() {
if [ -f /etc/rc.common ] && [ "$(cat /proc/1/comm)" = "procd" ]; then [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ] && /etc/init.d/shellcrash enable
/etc/init.d/shellcrash enable
fi
ckcmd systemctl && systemctl enable shellcrash.service >/dev/null 2>&1 ckcmd systemctl && systemctl enable shellcrash.service >/dev/null 2>&1
grep -q 's6' /proc/1/comm && touch /etc/s6-overlay/s6-rc.d/user/contents.d/afstart grep -q 's6' /proc/1/comm && touch /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
rc-status -r >/dev/null 2>&1 && rc-update add shellcrash default >/dev/null 2>&1 rc-status -r >/dev/null 2>&1 && rc-update add shellcrash default >/dev/null 2>&1
@@ -27,225 +24,160 @@ disable_autostart() {
setboot() { setboot() {
while true; do while true; do
[ -z "$start_old" ] && start_old=OFF [ -z "$start_old" ] && start_old=OFF
[ -z "$start_delay" -o "$start_delay" = 0 ] && delay=未设置 || delay="${start_delay}"
if [ -z "$start_delay" ] || [ "$start_delay" = 0 ]; then check_autostart && auto_set="\033[33m禁止" || auto_set="\033[32m允许"
delay=未设置
else
delay="${start_delay}"
fi
check_autostart && auto_set="ON" || auto_set="OFF"
[ "${BINDIR}" = "$CRASHDIR" ] && mini_clash=OFF || mini_clash=ON [ "${BINDIR}" = "$CRASHDIR" ] && mini_clash=OFF || mini_clash=ON
[ -z "$network_check" ] && network_check=ON [ -z "$network_check" ] && network_check=ON
comp_box "\033[30;47m启动设置菜单\033[0m" echo "-----------------------------------------------"
content_line "1) 开机自启动: \033[36m$(printf '%-4s' "$auto_set")\033[0m" echo -e "\033[30;47m欢迎使用启动设置菜单\033[0m"
content_line "2) 使用保守模式: \033[36m$(printf '%-4s' "$start_old")\033[0m ———基于定时任务(每分钟检测)" echo "-----------------------------------------------"
content_line "3) 设置自启延时: \033[36m$(printf '%-7s' "$delay")\033[0m ———用于解决自启后服务受限" echo -e " 1 ${auto_set}\033[0mShellCrash开机启动"
content_line "4) 启用小闪存模式: \033[36m$(printf '%-4s' "$mini_clash")\033[0m ———用于闪存空间不足的设备" echo -e " 2 使用保守模式: \033[36m$start_old\033[0m ————基于定时任务(每分钟检测)"
[ "${BINDIR}" != "$CRASHDIR" ] && content_line "5) 设置小闪存目录: \033[36m${BINDIR}\033[0m" echo -e " 3 设置自启延时: \033[36m$delay\033[0m ————用于解决自启后服务受限"
btm_box "6) 自启网络检查: \033[36m$(printf '%-4s' "$network_check")\033[0m ———禁用则跳过自启时网络检查" \ echo -e " 4 启用小闪存模式: \033[36m$mini_clash\033[0m ————用于闪存空间不足的设备"
"7) 查看启动日志" \ [ "${BINDIR}" != "$CRASHDIR" ] && echo -e " 5 设置小闪存目录: \033[36m${BINDIR}\033[0m"
"" \ echo -e " 6 自启网络检查: \033[36m$network_check\033[0m ————禁用则跳过自启时网络检查"
"0) 返回上级菜单" echo "-----------------------------------------------"
read -r -p "请输入对应标号> " num echo -e " 0 \033[0m返回上级菜单\033[0m"
read -p "请输入对应数字 > " num
echo "-----------------------------------------------"
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
if check_autostart; then if check_autostart; then
# 禁止自启动:删除各系统的启动项 # 禁止自启动:删除各系统的启动项
disable_autostart disable_autostart
msg_alert "\033[33m已禁止ShellCrash开机启动!\033[0m" echo -e "\033[33m已禁止ShellCrash开机启动\033[0m"
else else
# 允许自启动:配置各系统的启动项 # 允许自启动:配置各系统的启动项
allow_autostart allow_autostart
msg_alert "\033[32m已设置ShellCrash开机启动!\033[0m" echo -e "\033[32m已设置ShellCrash开机启动\033[0m"
fi fi
;; ;;
2) 2)
if [ "$start_old" = "OFF" ] >/dev/null 2>&1; then if [ "$start_old" = "OFF" ] >/dev/null 2>&1; then
echo -e "\033[33m改为使用保守模式启动服务\033[0m"
disable_autostart disable_autostart
start_old=ON start_old=ON
setconfig start_old "$start_old" setconfig start_old "$start_old"
"$CRASHDIR"/start.sh stop "$CRASHDIR"/start.sh stop
msg_alert "\033[33m改为使用保守模式启动服务\033[0m"
else else
if grep -qE 'procd|systemd|s6' /proc/1/comm || rc-status -r >/dev/null 2>&1; then if grep -qE 'procd|systemd|s6' /proc/1/comm || rc-status -r >/dev/null 2>&1; then
echo -e "\033[32m改为使用系统守护进程启动服务\033[0m"
"$CRASHDIR"/start.sh cronset "ShellCrash初始化" "$CRASHDIR"/start.sh cronset "ShellCrash初始化"
start_old=OFF start_old=OFF
setconfig start_old "$start_old" setconfig start_old "$start_old"
"$CRASHDIR"/start.sh stop "$CRASHDIR"/start.sh stop
msg_alert "\033[32m改为使用系统守护进程启动服务\033[0m"
else else
msg_alert "\033[31m当前设备不支持以其他模式启动\033[0m" echo -e "\033[31m当前设备不支持以其他模式启动\033[0m"
fi fi
fi fi
sleep 1
;; ;;
3) 3)
comp_box "\033[33m如果你的设备启动后可以正常使用则无需设置\033[0m" \ echo -e "\033[33m如果你的设备启动后可以正常使用则无需设置\033[0m"
"\033[36m推荐设置为30120秒之间请根据设备问题自行试验\033[0m" echo -e "\033[36m推荐设置为30~120秒之间请根据设备问题自行试验\033[0m"
read -r -p "请输入启动延迟时间0300秒> " sec read -p "请输入启动延迟时间(0~300秒) > " sec
case "$sec" in case "$sec" in
[0-9] | [0-9][0-9] | [0-2][0-9][0-9] | 300) [0-9] | [0-9][0-9] | [0-2][0-9][0-9] | 300)
start_delay=$sec start_delay=$sec
setconfig start_delay "$sec" setconfig start_delay $sec
msg_alert "\033[32m设置成功\033[0m" echo -e "\033[32m设置成功\033[0m"
;; ;;
*) *)
msg_alert "\033[31m输入有误或超过300秒请重新输入\033[0m" echo -e "\033[31m输入有误或超过300秒请重新输入\033[0m"
;; ;;
esac esac
sleep 1
;; ;;
4) 4)
dir_size=$(df "$CRASHDIR" | 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}') dir_size=$(df "$CRASHDIR" | 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}')
if [ "$mini_clash" = "OFF" ]; then if [ "$mini_clash" = "OFF" ]; then
if [ "$dir_size" -gt 20480 ]; then if [ "$dir_size" -gt 20480 ]; then
msg_alert "\033[33m您的设备空间充足>20M,无需开启!\033[0m" echo -e "\033[33m您的设备空间充足(>20M),无需开启!\033[0m"
elif [ "$start_old" != 'ON' ] && [ "$(cat /proc/1/comm)" = "systemd" ]; then elif [ "$start_old" != 'ON' -a "$(cat /proc/1/comm)" = "systemd" ]; then
msg_alert "\033[33m不支持systemd启动模式请先启用保守模式\033[0m" echo -e "\033[33m不支持systemd启动模式请先启用保守模式\033[0m"
else else
[ "$BINDIR" = "$CRASHDIR" ] && BINDIR="$TMPDIR" [ "$BINDIR" = "$CRASHDIR" ] && BINDIR="$TMPDIR"
msg_alert "\033[32m已经启用小闪存功能\033[0m" \ echo -e "\033[32m已经启用小闪存功能\033[0m"
"如需更换目录,请使用【设置小闪存目录】功能\033[0m" echo -e "如需更换目录,请使用【设置小闪存目录】功能\033[0m"
fi fi
else else
if [ "$dir_size" -lt 8192 ]; then if [ "$dir_size" -lt 8192 ]; then
comp_box "\033[31m您的设备剩余空间不足8M停用后可能无法正常运行\033[0m" \ echo -e "\033[31m您的设备剩余空间不足8M停用后可能无法正常运行\033[0m"
"是否确认停用此功能?" read -p "确认停用此功能?(1/0) > " res
btm_box "1) 是" \ [ "$res" = 1 ] && BINDIR="$CRASHDIR" && echo -e "\033[33m已经停用小闪存功能\033[0m"
"0) 否,返回上级菜单"
read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then
BINDIR="$CRASHDIR"
msg_alert "\033[33m已经停用小闪存功能\033[0m"
else
continue
fi
else else
rm -rf /tmp/ShellCrash rm -rf /tmp/ShellCrash
BINDIR="$CRASHDIR" BINDIR="$CRASHDIR"
msg_alert "\033[33m已经停用小闪存功能\033[0m" echo -e "\033[33m已经停用小闪存功能\033[0m"
fi fi
fi fi
sed -i "s#BINDIR=.*#BINDIR=$BINDIR#" "$CRASHDIR"/configs/command.env setconfig BINDIR "$BINDIR" "$CRASHDIR"/configs/command.env
sleep 1 sleep 1
;; ;;
5) 5)
while true; do echo -e "\033[33m如设置到内存则每次开机后都自动重新下载相关文件\033[0m"
comp_box "\033[33m如设置到内存则每次开机后都自动重新下载相关文件\033[0m" \ echo -e "\033[33m请确保安装源可用裸连否则会导致启动失败\033[0m"
"\033[33m请确保安装源可用裸连否则会导致启动失败\033[0m" echo " 1 使用内存(/tmp)"
btm_box "1) 使用内存(/tmp" \ echo " 2 选择U盘目录"
"2) 选择U盘目录" \ echo " 3 自定义目录"
"3) 自定义目录" \ read -p "请输入相应数字 > " num
"" \ case "$num" in
"0) 返回上级菜单" 1)
read -r -p "请输入对应标号> " num BINDIR="$TMPDIR"
case "$num" in ;;
"" | 0) 2)
break set_usb_dir() {
;; echo "请选择安装目录"
1) du -hL /mnt | awk '{print " "NR" "$2" "$1}'
BINDIR="$TMPDIR" read -p "请输入相应数字 > " num
;; BINDIR=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
2) if [ -z "$BINDIR" ]; then
set_usb_dir() { echo "\033[31m输入错误请重新设置\033[0m"
while true; do set_usb_dir
comp_box "请选择安装目录:"
du -hL /mnt |
awk '{print NR") "$2" (已占用的储存空间:"$1""}' |
while IFS= read -r line; do
content_line "$line"
done
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num
BINDIR=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
if [ "$num" = 0 ]; then
return 1
elif [ -z "$BINDIR" ]; then
msg_alert "\033[31m输入错误请重新设置\033[0m"
else
return 0
fi
done
}
set_usb_dir
if [ $? -eq 1 ]; then
continue
fi fi
;; }
3) set_usb_dir
input_dir() { ;;
while true; do 3)
comp_box "\033[36m请直接输入命令语句\033[0m" \ input_dir() {
"输入 0 返回上级菜单" read -p "输入自定义目录 > " BINDIR
read -r -p "请输入> " BINDIR if [ ! -d "$BINDIR" ]; then
if [ "$BINDIR" = 0 ]; then echo "\033[31m输入错误请重新设置\033[0m"
return 1 input_dir
elif [ ! -d "$BINDIR" ]; then
msg_alert "\033[31m输入错误请重新设置\033[0m"
fi
return 0
done
}
input_dir
if [ $? -eq 1 ]; then
continue
fi fi
;; }
*) input_dir
errornum ;;
continue *)
;; errornum
esac ;;
sed -i "s#BINDIR=.*#BINDIR=$BINDIR#" "$CRASHDIR"/configs/command.env esac
break setconfig BINDIR "$BINDIR" "$CRASHDIR"/configs/command.env
done
;; ;;
6) 6)
comp_box "\033[33m如果你的设备启动后可以正常使用则无需变更设置\033[0m" \ echo -e "\033[33m如果你的设备启动后可以正常使用则无需变更设置\033[0m"
"\033[36m禁用时如果使用了小闪存模式或者rule-set等在线规则则可能会因无法联网而导致启动失败\033[0m" \ echo -e "\033[36m禁用时如果使用了小闪存模式或者rule-set等在线规则则可能会因无法联网而导致启动失败\033[0m"
"\033[32m启用时会导致部分性能较差或者拨号较慢的设备可能会因查询超时导致启动失败\033[0m" echo -e "\033[32m启用时会导致部分性能较差或者拨号较慢的设备可能会因查询超时导致启动失败\033[0m"
read -p "是否切换?(1/0) > " res
if [ "$network_check" = "OFF" ]; then [ "$res" = '1' ] && {
content_line "当前\033[33m已禁用\033[0m自启网络检查是否确认启用"
else
content_line "当前\033[33m已启用\033[0m自启网络检查是否确认禁用"
fi
separator_line "-"
btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "请输入对应标号> " res
if [ "$res" = '1' ]; then
if [ "$network_check" = "OFF" ]; then if [ "$network_check" = "OFF" ]; then
network_check=ON network_check=ON
else else
network_check=OFF network_check=OFF
fi fi
if setconfig network_check "$network_check"; then setconfig network_check "$network_check"
common_success }
else sleep 1
common_failed
fi
fi
;;
7)
if [ -s "$TMPDIR"/ShellCrash.log ]; then
line_break
echo "==========================================================="
grep -v '任务' "$TMPDIR"/ShellCrash.log
echo "==========================================================="
line_break
exit
else
msg_alert "\033[31m未找到相关日志\033[0m"
fi
;; ;;
*) *)
errornum errornum
sleep 1
break
;; ;;
esac esac
done done

View File

@@ -4,381 +4,341 @@
[ -n "$__IS_MODULE_5_TASK_LOADED" ] && return [ -n "$__IS_MODULE_5_TASK_LOADED" ] && return
__IS_MODULE_5_TASK_LOADED=1 __IS_MODULE_5_TASK_LOADED=1
# 通用工具 #通用工具
. "$CRASHDIR"/libs/set_config.sh . "$CRASHDIR"/libs/set_config.sh
. "$CRASHDIR"/libs/set_cron.sh . "$CRASHDIR"/libs/set_cron.sh
#任务工具
load_lang 5_task set_cron(){
[ -z $week ] && week=*
# 任务工具 [ -z $hour ] && hour=*
set_cron() { [ -z $min ] && min=0
[ -z "$week" ] && week=* echo "-----------------------------------------------"
[ -z "$hour" ] && hour=* echo -e "\033[33m$cron_time\033[0m执行任务:\033[36m$task_name\033[0m"
[ -z "$min" ] && min=0 read -p "是否确认添加定时任务?(1/0) > " res
comp_box "\033[33m$cron_time\033[0m执行任务\033[36m$task_name\033[0m" \ if [ "$res" = '1' ]; then
"" \ task_txt="$min $hour * * $week $CRASHDIR/task/task.sh $task_id $cron_time$task_name"
"是否确认添加定时任务?" cronset "$cron_time$task_name" "$task_txt"
btm_box "1) 是" \ echo -e "任务【$cron_time$task_name】\033[32m已添加\033[0m"
"0) 否" fi
read -r -p "请输入对应标号> " res unset week hour min
if [ "$res" = '1' ]; then sleep 1
task_txt="$min $hour * * $week $CRASHDIR/task/task.sh $task_id $cron_time$task_name"
cronset "$cron_time$task_name" "$task_txt"
msg_alert -t 0 "任务【$cron_time$task_name】\033[32m已添加\033[0m"
fi
unset week hour min
sleep 1
} }
set_service(){
set_service() { # 参数1代表要任务类型,参数2代表任务ID,参数3代表任务描述,参数4代表running任务cron时间
# 参数1代表要任务类型,参数2代表任务ID,参数3代表任务描述,参数4代表running任务cron时间 task_file="$CRASHDIR"/task/$1
task_file="$CRASHDIR"/task/$1 [ -s $task_file ] && sed -i "/$3/d" $task_file
[ -s "$task_file" ] && sed -i "/$3/d" "$task_file" #运行时每分钟执行的任务特殊处理
# 运行时每分钟执行的任务特殊处理 if [ "$1" = "running" ];then
if [ "$1" = "running" ]; then task_txt="$4 $CRASHDIR/task/task.sh $2 $3"
task_txt="$4 $CRASHDIR/task/task.sh $2 $3" echo "$task_txt" >> $task_file
echo "$task_txt" >>"$task_file" [ -n "$(pidof CrashCore)" ] && cronset "$3" "$task_txt"
[ -n "$(pidof CrashCore)" ] && cronset "$3" "$task_txt" else
else echo "$CRASHDIR/task/task.sh $2 $3" >> $task_file
echo "$CRASHDIR/task/task.sh $2 $3" >>"$task_file" fi
fi echo -e "任务【$3】\033[32m添加成功\033[0m"
content_line "$3】\033[32m$COMMON_SUCCESS\033[0m" sleep 1
sleep 1
} }
#任务界面
# 任务界面 task_user_add(){ #自定义命令添加
# echo "-----------------------------------------------"
# 自定义命令添加 echo -e "\033[33m命令可包含空格请确保命令可执行\033[0m"
task_user_add() { echo -e "\033[36m此处不要添加执行条件请在添加完成后返回添加具体执行条件\033[0m"
while true; do echo -e "也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m添加"
comp_box "\033[33m命令可包含空格请确保命令可执行\033[0m" \ read -p "请输入命令语句 > " script
"\033[36m请勿附带执行条件执行条件请在命令添加完成后再返回设置\033[0m" \ if [ -n "$script" ];then
"亦可手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m以添加命令" task_command=$script
btm_box "\033[36m请直接输入命令语句\033[0m" \ echo -e "请检查输入:\033[32m$task_command\033[0m"
"或输入 0 返回上级菜单" #获取本任务ID
read -r -p "请输入> " script task_max_id=$(awk -F '#' '{print $1}' "$CRASHDIR"/task/task.user 2>/dev/null | sort -n | tail -n 1)
if [ "$script" = 0 ]; then [ -z "$task_max_id" ] && task_max_id=200
break task_id=$((task_max_id + 1))
elif [ -n "$script" ]; then read -p "请输入任务备注 > " txt
task_command=$script [ -n "$txt" ] && task_name=$txt || task_name=自定义任务$task_id
comp_box "请检查输入:\033[32m$task_command\033[0m" echo "$task_id#$task_command#$task_name" >> "$CRASHDIR"/task/task.user
# 获取本任务ID echo -e "\033[32m自定义任务已添加\033[0m"
task_max_id=$(awk -F '#' '{print $1}' "$CRASHDIR"/task/task.user 2>/dev/null | sort -n | tail -n 1) sleep 1
[ -z "$task_max_id" ] && task_max_id=200 else
task_id=$((task_max_id + 1)) echo -e "\033[31m输入错误请重新输入\033[0m"
read -r -p "请输入任务备注> " txt sleep 1
[ -n "$txt" ] && task_name=$txt || task_name=自定义任务$task_id fi
echo "$task_id#$task_command#$task_name" >>"$CRASHDIR"/task/task.user
msg_alert "\033[32m自定义任务已添加\033[0m"
break
else
msg_alert "\033[31m输入错误请重新输入\033[0m"
fi
done
} }
task_user_del(){ #自定义命令删除
# 自定义命令删除 echo "-----------------------------------------------"
task_user_del() { echo -e "请输入对应ID移除对应自定义任务(不会影响内置任务)"
while true; do echo -e "也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m"
if grep -Evq '^#' "$CRASHDIR/task/task.user" 2>/dev/null; then echo "-----------------------------------------------"
comp_box "请输入对应ID移除对应自定义任务不会影响内置任务" \ cat "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^#' | awk -F '#' '{print $1" "$3}'
"也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m" echo "-----------------------------------------------"
grep -Ev '^#' "$CRASHDIR/task/task.user" 2>/dev/null | echo "0 返回上级菜单"
awk -F '#' '{print $1") "$3}' | echo "-----------------------------------------------"
while IFS= read -r line; do read -p "请输入对应数字 > " num
content_line "$line" if [ -n "$num" ];then
done sed -i "/^$num#/d" "$CRASHDIR"/task/task.user 2>/dev/null
btm_box "" \ [ "$num" != 0 ] && task_user_del
"0) 返回上级菜单" else
read -r -p "请输入对应标号> " num echo -e "\033[31m输入错误请重新输入\033[0m"
if [ "$num" = 0 ]; then sleep 1
break fi
elif [ -n "$num" ]; then
sed -i "/^$num#/d" "$CRASHDIR"/task/task.user 2>/dev/null
common_success
else
msg_alert "\033[31m输入错误请重新输入\033[0m"
fi
else
msg_alert "\033[33m你暂未添加任何自定义任务\033[0m"
break
fi
done
} }
task_add(){ #任务添加
# 任务添加 echo "-----------------------------------------------"
task_add() { echo -e "\033[36m请选择需要添加的任务\033[0m"
while true; do echo "-----------------------------------------------"
comp_box "\033[36m请选择需要添加的任务\033[0m" #输出任务列表
# 输出任务列表 cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | awk -F '#' '{print " "NR" "$3}'
list=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | awk -F '#' '{print $3}') echo "-----------------------------------------------"
list_box "$list" echo -e " 0 返回上级菜单"
btm_box "" \ read -p "请输入对应数字 > " num
"0) 返回上级菜单" case "$num" in
read -r -p "请输入对应标号> " num 0)
case "$num" in ;;
0) [1-9]|[1-9][0-9])
break if [ "$num" -le "$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | wc -l)" ];then
;; task_id=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $1}')
[1-9] | [1-9][0-9]) task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $3}')
if [ "$num" -le "$(echo "$list" | wc -l)" ]; then task_type
task_id=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $1}') else
task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $3}') errornum
task_type fi
break ;;
else *)
errornum errornum
fi ;;
;; esac
*)
errornum
;;
esac
done
} }
task_del(){ #任务删除
# 任务删除 #删除定时任务
task_del() { cronset "$1"
# 删除定时任务 #删除条件任务
cronset "$1" sed -i "/$1/d" "$CRASHDIR"/task/cron 2>/dev/null
# 删除条件任务 sed -i "/$1/d" "$CRASHDIR"/task/bfstart 2>/dev/null
sed -i "/$1/d" "$CRASHDIR"/task/cron 2>/dev/null sed -i "/$1/d" "$CRASHDIR"/task/afstart 2>/dev/null
sed -i "/$1/d" "$CRASHDIR"/task/bfstart 2>/dev/null sed -i "/$1/d" "$CRASHDIR"/task/running 2>/dev/null
sed -i "/$1/d" "$CRASHDIR"/task/afstart 2>/dev/null sed -i "/$1/d" "$CRASHDIR"/task/affirewall 2>/dev/null
sed -i "/$1/d" "$CRASHDIR"/task/running 2>/dev/null
sed -i "/$1/d" "$CRASHDIR"/task/affirewall 2>/dev/null
} }
task_type(){ #任务条件选择菜单
echo "-----------------------------------------------"
echo -e "请选择任务\033[36m【$task_name】\033[0m执行条件"
echo "-----------------------------------------------"
echo -e " 1 定时任务\033[32m每周执行\033[0m"
echo -e " 2 定时任务\033[32m每日执行\033[0m"
echo -e " 3 定时任务\033[32m每小时执行\033[0m"
echo -e " 4 定时任务\033[32m每分钟执行\033[0m"
echo "-----------------------------------------------"
echo -e "\033[31m注意\033[0m逻辑水平不及格的请勿使用下方触发条件"
echo "-----------------------------------------------"
echo -e " 5 服务\033[33m启动前执行\033[0m"
echo -e " 6 服务\033[33m启动后执行\033[0m"
echo -e " 7 服务\033[33m运行时每分钟执行\033[0m"
echo -e " 8 防火墙服务\033[33m重启后执行\033[0m"
echo "-----------------------------------------------"
echo -e " 0 返回上级菜单"
read -p "请输入对应数字 > " num
case "$num" in
# 任务条件选择菜单 0)
task_type() { return 1
comp_box "请选择任务\033[36m【$task_name】\033[0m执行条件" ;;
btm_box "1) 定时任务\033[32m每周执行\033[0m" \ 1)
"2) 定时任务\033[32m每日执行\033[0m" \ echo "-----------------------------------------------"
"3) 定时任务\033[32m每小时执行\033[0m" \ echo -e " 输入 1-7 对应\033[33m每周的指定某天\033[0m运行(7=周日)"
"4) 定时任务\033[32m每分钟执行\033[0m" \ echo -e " 输入 1,4,0 代表\033[36m每周一、周四、周日\033[0m运行"
" - - - - - - - - -\033[31m注意\033[0m- - - - - - - - -" \ echo -e " 输入 1-5 代表\033[36m周一至周五\033[0m运行"
" 逻辑水平不及格的请勿使用下方触发条件!" \ read -p "在每周哪天执行? > " week
" - - - - - - - - - - - - - - - - - - - -" \ week=`echo ${week/7/0}` #把7换成0
"5) 服务\033[33m启动前执行\033[0m" \ echo "-----------------------------------------------"
"6) 服务\033[33m启动后执行\033[0m" \ read -p "想在该日的具体哪个小时执行0-23 > " hour
"7) 服务\033[33m运行时每分钟执行\033[0m" \ cron_time="在每周$week的$hour点整"
"8) 防火墙服务\033[33m重启后执行\033[0m" \ cron_time=`echo ${cron_time/周0/周日}` #把0换成日
"" \ [ -n "$week" ] && [ -n "$hour" ] && set_cron
"0) 返回上级菜单" ;;
read -r -p "请输入对应标号> " num 2)
case "$num" in echo "-----------------------------------------------"
0) echo -e " 输入 1,7,15 代表\033[36m每到1,7,15点\033[0m运行"
return 1 echo -e " 输入 6-18 代表\033[36m早6点至晚18点间每小时\033[0m运行"
;; read -p "想在每日的具体哪个小时执行0-23 > " hour
1) echo "-----------------------------------------------"
read -p "想在具体哪分钟执行0-59的整数 > " min
comp_box "输入 17 对应\033[33m每周的指定某天\033[0m运行7=周日)" \ cron_time="在每日的$hour点$min分"
"输入 140 代表\033[36m每周一、周四、周日\033[0m运行" \ [ -n "$min" ] && [ -n "$hour" ] && set_cron
"输入 15 代表\033[36m周一至周五\033[0m运行" ;;
read -r -p "在每周哪天执行?> " week 3)
# week=`echo ${week/7/0}` # 把7换成0 echo "-----------------------------------------------"
read -r -p "想在该日的具体哪个小时执行023> " hour read -p "想每隔多少小时执行一次1-23的整数 > " num
cron_time="在每周$week的$hour点整" hour="*/$num"
# cron_time=`echo ${cron_time/周0/周日}` # 把0换成日 cron_time="每隔$num小时"
[ -n "$week" ] && [ -n "$hour" ] && set_cron [ -n "$hour" ] && set_cron
;; ;;
2) 4)
comp_box "输入 1715 代表\033[36m每到1715点\033[0m运行" \ echo "-----------------------------------------------"
"输入 618 代表\033[36m早6点至晚18点间每小时\033[0m运行" read -p "想每隔多少分钟执行一次1-59的整数 > " num
read -r -p "想在每日的具体哪个小时执行0~23> " hour min="*/$num"
read -r -p "想在具体哪分钟执行059的整数> " min cron_time="每隔$num分钟"
cron_time="在每日的$hour点$min" [ -n "$min" ] && set_cron
[ -n "$min" ] && [ -n "$hour" ] && set_cron ;;
;; 5)
3) set_service bfstart "$task_id" "服务启动前$task_name"
line_break ;;
read -r -p "想每隔多少小时执行一次123的整数> " num 6)
hour="*/$num" set_service afstart "$task_id" "服务启动后$task_name"
cron_time="每隔$num小时" ;;
[ -n "$hour" ] && set_cron 7)
;; echo "-----------------------------------------------"
4) echo -e " 输入10即每隔10分钟运行一次1440即每隔24小时运行一次"
line_break echo -e " 大于60分钟的数值将按小时取整,且按当前时区记时"
read -r -p "想每隔多少分钟执行一次159的整数)> " num read -p "想每隔多少分钟执行一次1-1440的整数) > " num
min="*/$num" if [ "$num" -lt 60 ];then
cron_time="每隔$num分钟" min="$num"
[ -n "$min" ] && set_cron cron_time="*/$min * * * *"
;; time_des="$min分钟"
5) else
set_service bfstart "$task_id" "服务启动前$task_name" hour="$((num / 60))"
;; cron_time="0 */$hour * * *"
6) time_des="$hour小时"
set_service afstart "$task_id" "服务启动后$task_name" fi
;; [ -n "$cron_time" ] && set_service running "$task_id" "运行时每$time_des$task_name" "$cron_time"
7) ;;
comp_box "输入10即每隔10分钟运行一次1440即每隔24小时运行一次" \ 8)
"大于60分钟的数值将按小时取整且按当前时区记时" echo -e "该功能会将相关启动代码注入到/etc/init.d/firewall中"
read -r -p "想每隔多少分钟执行一次11440的整数> " num read -p "是否继续?(1/0) > " res
if [ "$num" -lt 60 ]; then [ "$res" = 1 ] && set_service affirewall "$task_id" "防火墙重启后$task_name"
min="$num" ;;
cron_time="*/$min * * * *" *)
time_des="$min分钟" errornum
else return 1
hour="$((num / 60))" ;;
cron_time="0 */$hour * * *" esac
time_des="$hour小时"
fi
[ -n "$cron_time" ] && set_service running "$task_id" "运行时每$time_des$task_name" "$cron_time"
;;
8)
comp_box "该功能会将相关启动代码注入到/etc/init.d/firewall中"
"是否确认继续?"
btm_box "1) 是" \
"0) 否"
read -r -p "请输入对应标号> " res
[ "$res" = 1 ] && set_service affirewall "$task_id" "防火墙重启后$task_name"
;;
*)
errornum
;;
esac
} }
task_manager(){ #任务管理列表
echo "-----------------------------------------------"
#抽取并生成临时列表
cronload > "$TMPDIR"/task_cronlist
cat "$TMPDIR"/task_cronlist "$CRASHDIR"/task/running 2>/dev/null | sort -u | grep -oE "task/task.sh .*" | awk -F ' ' '{print $2" "$3}' > "$TMPDIR"/task_list
cat "$CRASHDIR"/task/bfstart "$CRASHDIR"/task/afstart "$CRASHDIR"/task/affirewall 2>/dev/null | awk -F ' ' '{print $2" "$3}' >> "$TMPDIR"/task_list
cat "$TMPDIR"/task_cronlist 2>/dev/null | sort -u | grep -oE " #.*" | grep -v "守护" | awk -F '#' '{print "0 旧版任务-"$2}' >> "$TMPDIR"/task_list
sed -i '/^ *$/d' "$TMPDIR"/task_list
rm -rf "$TMPDIR"/task_cronlist
#判断为空则返回
if [ ! -s "$TMPDIR"/task_list ];then
echo -e "\033[31m当前没有可供管理的任务\033[36m"
sleep 1
else
echo -e "\033[33m已添加的任务:\033[0m"
echo "-----------------------------------------------"
cat "$TMPDIR"/task_list | awk '{print " " NR " " $2}'
echo "-----------------------------------------------"
echo -e " a 清空旧版任务"
echo -e " d 清空任务列表"
echo -e " 0 返回上级菜单"
read -p "请输入对应数字 > " num
case "$num" in
0)
;;
a)
task_del "#"
echo -e "\033[31m旧版任务已清空\033[36m"
sleep 1
;;
d)
task_del "task.sh"
echo -e "\033[31m全部任务已清空\033[36m"
sleep 1
;;
[1-9]|[1-9][0-9])
# 任务管理列表 task_txt=$(sed -n "$num p" "$TMPDIR"/task_list)
task_manager() { task_id=$(echo $task_txt | awk '{print $1}')
while true; do if [ "$task_id" = 0 ];then
# 抽取并生成临时列表 read -p "旧版任务不支持管理,是否移除?(1/0) > " res
cronload >"$TMPDIR"/task_cronlist [ "$res" = 1 ] && {
cat "$TMPDIR"/task_cronlist "$CRASHDIR"/task/running 2>/dev/null | sort -u | grep -oE "task/task.sh .*" | cut -d ' ' -f 2- >"$TMPDIR"/task_list cronname=$(echo $task_txt | awk -F '-' '{print $2}')
cat "$CRASHDIR"/task/bfstart "$CRASHDIR"/task/afstart "$CRASHDIR"/task/affirewall 2>/dev/null | cut -d ' ' -f 2- >>"$TMPDIR"/task_list cronset "$cronname"
cat "$TMPDIR"/task_cronlist 2>/dev/null | sort -u | grep -oE " #.*" | grep -v "守护" | awk -F '#' '{print "0 旧版任务-"$2}' >>"$TMPDIR"/task_list sed -i "/$cronname/d" "$CRASHDIR"/task/cron 2>/dev/null
sed -i '/^ *$/d' "$TMPDIR"/task_list }
rm -rf "$TMPDIR"/task_cronlist else
# 判断为空则返回 task_des=$(echo $task_txt | awk '{print $2}')
if [ ! -s "$TMPDIR"/task_list ]; then task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $3}')
msg_alert "\033[31m当前没有可供管理的任务\033[36m" echo "-----------------------------------------------"
break echo -e "当前任务为:\033[36m $task_des\033[0m"
else echo -e " 1 \033[33m修改\033[0m当前任务"
comp_box "\033[33m已添加的任务\033[0m" echo -e " 2 \033[31m删除\033[0m当前任务"
list_box "$(cat "$TMPDIR"/task_list)" echo -e " 3 \033[32m立即执行\033[0m一次"
separator_line "-" echo -e " 4 查看\033[33m执行记录\033[0m"
btm_box "a) 清空旧版任务" \ echo "-----------------------------------------------"
"d) 清空任务列表" \ echo -e " 0 返回上级菜单"
"" \ read -p "请选择需要执行的操作 > " num
"0) 返回上级菜单" case "$num" in
read -r -p "请输入对应标号> " num 0)
case "$num" in ;;
"" | 0) 1)
break task_type && task_del $task_des
;; ;;
a) 2)
task_del "#" task_del $task_des
msg_alert "\033[31m旧版任务已清空\033[36m" ;;
;; 3)
d) task_command=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $2}')
task_del "task.sh" eval $task_command && task_res='执行成功!' || task_res='执行失败!'
msg_alert "\033[31m全部任务已清空\033[36m" echo -e "\033[33m任务【$task_des$task_res\033[0m"
;; sleep 1
[1-9] | [1-9][0-9]) ;;
task_txt=$(sed -n "$num p" "$TMPDIR"/task_list) 4)
task_id=$(echo "$task_txt" | awk '{print $1}') echo "-----------------------------------------------"
if [ -n "$(cat "$TMPDIR"/ShellCrash.log | grep "$task_name")" ];then
if [ "$task_id" = 0 ]; then cat "$TMPDIR"/ShellCrash.log | grep "$task_name"
comp_box "旧版任务不支持管理,是否移除?" else
btm_box "1) 是" \ echo -e "\033[31m未找到相关执行记录\033[0m"
"0) 否,返回上级菜单" fi
read -r -p "请输入对应标号> " res sleep 1
if [ "$res" = 1 ]; then ;;
cronname=$(echo "$task_txt" | awk -F '-' '{print $2}') *)
cronset "$cronname" errornum
sed -i "/$cronname/d" "$CRASHDIR"/task/cron 2>/dev/null ;;
esac
break fi
fi task_manager
else ;;
task_des=$(echo "$task_txt" | awk '{print $2}') *)
task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $3}') errornum
comp_box "当前任务为:\033[36m$task_des\033[0m" ;;
btm_box "1) \033[33m修改\033[0m当前任务" \ esac
"2) \033[31m删除\033[0m当前任务" \ fi
"3) \033[32m立即执行\033[0m一次" \
"4) 查看\033[33m执行记录\033[0m" \
"" \
"0) 返回上级菜单"
read -r -p "请输入对应标号> " num
case "$num" in
"" | 0)
continue
;;
1)
task_type && task_del "$task_des"
;;
2)
task_del "$task_des"
common_success
;;
3)
task_command=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $2}')
eval "$task_command" && task_res='执行成功!' || task_res='执行失败!'
msg_alert "\033[33m任务【$task_des$task_res\033[0m"
;;
4)
if cat "$TMPDIR"/ShellCrash.log | grep -q "$task_name"; then
line_break
echo "==========================================================="
cat "$TMPDIR"/ShellCrash.log | grep "$task_name"
echo "==========================================================="
else
msg_alert "\033[31m未找到相关执行记录\033[0m"
fi
;;
*)
errornum
;;
esac
fi
;;
*)
errornum
;;
esac
fi
done
} }
task_recom(){ #任务推荐
# 任务推荐 echo "-----------------------------------------------"
task_recom() { echo -e "\033[32m启用推荐的自动任务配置这包括\033[0m"
comp_box "\033[36m$TASK_RECOM_TITLE\033[0m" \ echo "-----------------------------------------------"
"" \ echo -e "每隔10分钟自动保存面板配置"
"$TASK_RECOM_ITEM_1" \ echo -e "服务启动后自动同步ntp时间"
"$TASK_RECOM_ITEM_2" \ echo -e "在每日的3点0分重启服务"
"$TASK_RECOM_ITEM_3" echo "-----------------------------------------------"
btm_box "1) 是" \ read -p "是否启用?(1/0) > " res
"0) 否" [ "$res" = 1 ] && {
read -r -p "$COMMON_INPUT>" res set_service running "106" "运行时每10分钟自动保存面板配置" "*/10 * * * *"
set_service afstart "107" "服务启动后自动同步ntp时间"
[ "$res" = 1 ] && { cronset "在每日的3点0分重启服务" "0 3 * * * ${CRASHDIR}/task/task.sh 103 在每日的3点0分重启服务" && \
line_break echo -e "任务【在每日的3点0分重启服务】\033[32m添加成功\033[0m"
separator_line "=" }
set_service running "106" "$TASK_RECOM_ITEM_1" "*/10 * * * *"
set_service afstart "107" "$TASK_RECOM_ITEM_2"
cronset "$TASK_RECOM_ITEM_3" "0 3 * * * ${CRASHDIR}/task/task.sh 103 $TASK_RECOM_ITEM_3" &&
content_line "$TASK_RECOM_ITEM_3】\033[32m$COMMON_SUCCESS\033[0m"
separator_line "="
}
} }
# 任务菜单 # 任务菜单
task_menu() { task_menu() {
while true; do while true; do
# 检测并创建自定义任务文件 #检测并创建自定义任务文件
[ -f "$CRASHDIR"/task/task.user ] || echo '#任务ID(必须>200并顺序排列)#任务命令#任务说明(#号隔开,任务命令和说明中都不允许包含#号)' >"$CRASHDIR"/task/task.user [ -f "$CRASHDIR"/task/task.user ] || echo '#任务ID(必须>200并顺序排列)#任务命令#任务说明(#号隔开,任务命令和说明中都不允许包含#号)' >"$CRASHDIR"/task/task.user
comp_box "\033[30;47m自动任务菜单\033[0m" echo "-----------------------------------------------"
btm_box "1) 添加\033[32m自动任务\033[0m" \ echo -e "\033[30;47m欢迎使用自动任务功能:\033[0m"
"2) 管理\033[33m任务列表\033[0m" \ echo "-----------------------------------------------"
"3) 查看\033[36m任务日志\033[0m" \ echo -e " 1 添加\033[32m自动任务\033[0m"
"4) 配置\033[36m日志推送\033[0m" \ echo -e " 2 管理\033[33m任务列表\033[0m"
"5) 添加\033[33m自定义任务\033[0m" \ echo -e " 3 查看\033[36m任务日志\033[0m"
"6) 删除\033[33m自定义任务\033[0m" \ echo -e " 4 配置\033[36m日志推送\033[0m"
"7) 使用\033[32m推荐设置\033[0m" \ echo -e " 5 添加\033[33m自定义任务\033[0m"
"" \ echo -e " 6 删除\033[33m自定义任务\033[0m"
"0) 返回上级菜单" echo -e " 7 使用\033[32m推荐设置\033[0m"
read -r -p "请输入对应标号> " num echo "-----------------------------------------------"
echo -e " 0 返回上级菜单"
read -p "请输入对应数字 > " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -391,17 +351,17 @@ task_menu() {
rm -rf "$TMPDIR"/task_list rm -rf "$TMPDIR"/task_list
;; ;;
3) 3)
if cat "$TMPDIR"/ShellCrash.log | grep -q '任务【'; then if [ -n "$(cat "$TMPDIR"/ShellCrash.log | grep '任务【')" ]; then
line_break echo "-----------------------------------------------"
echo "==========================================================="
cat "$TMPDIR"/ShellCrash.log | grep '任务【' cat "$TMPDIR"/ShellCrash.log | grep '任务【'
echo "==========================================================="
else else
msg_alert "\033[31m未找到任务相关执行日志\033[0m" echo -e "\033[31m未找到任务相关执行日志\033[0m"
fi fi
sleep 1
;; ;;
4) 4)
msg_alert "\033[36m请在日志工具中配置相关推送通道及推送开关\033[0m" echo "-----------------------------------------------"
echo -e "\033[36m请在日志工具中配置相关推送通道及推送开关\033[0m"
. "$CRASHDIR"/menus/8_tools.sh && log_pusher . "$CRASHDIR"/menus/8_tools.sh && log_pusher
;; ;;
5) 5)
@@ -415,6 +375,8 @@ task_menu() {
;; ;;
*) *)
errornum errornum
sleep 1
break
;; ;;
esac esac
done done

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -159,7 +159,7 @@ download_file(){
} }
### --- 具体操作函数 --- ### ### --- 具体操作函数 --- ###
do_start_fw(){ do_start_fw(){
[ -z "$redir_mod_bf" ] && redir_mod_bf='Redir' [ -z "$redir_mod_bf" ] && redir_mod_bf='Redir模式'
redir_mod=$redir_mod_bf redir_mod=$redir_mod_bf
setconfig redir_mod $redir_mod setconfig redir_mod $redir_mod
"$CRASHDIR"/start.sh start_firewall "$CRASHDIR"/start.sh start_firewall
@@ -167,8 +167,8 @@ do_start_fw(){
} }
do_stop_fw(){ do_stop_fw(){
redir_mod_bf=$redir_mod redir_mod_bf=$redir_mod
firewall_area=4 redir_mod='纯净模式'
setconfig firewall_area 4 setconfig redir_mod $redir_mod
"$CRASHDIR"/start.sh stop_firewall "$CRASHDIR"/start.sh stop_firewall
echo "ShellCrash 已切换到纯净模式!" > "$LOGFILE" echo "ShellCrash 已切换到纯净模式!" > "$LOGFILE"
} }
@@ -244,7 +244,7 @@ polling(){
} }
[ -n "$CALLBACK" ] && case "$CALLBACK" in [ -n "$CALLBACK" ] && case "$CALLBACK" in
"start_redir") "start_redir")
if [ "$firewall_area" = 4 ];then if [ "$redir_mod" = '纯净模式' ];then
do_start_fw do_start_fw
send_msg "已切换到$redir_mod_bf" send_msg "已切换到$redir_mod_bf"
else else
@@ -254,7 +254,7 @@ polling(){
continue continue
;; ;;
"stop_redir") "stop_redir")
if [ "$firewall_area" != 4 ];then if [ "$redir_mod" != '纯净模式' ];then
do_stop_fw do_stop_fw
send_msg "已切换到纯净模式" send_msg "已切换到纯净模式"
else else

View File

@@ -3,56 +3,57 @@
. "$CRASHDIR"/libs/web_get_lite.sh . "$CRASHDIR"/libs/web_get_lite.sh
private_bot() { private_bot() {
comp_box "请先通过 \033[32;4mhttps://t.me/BotFather\033[0m 申请TG机器人并获取其\033[36mAPI TOKEN\033[0m" echo "-----------------------------------------------"
read -r -p "请输入你获取到的API TOKEN> " TOKEN echo -e "请先通过 \033[32;4mhttps://t.me/BotFather\033[0m 申请TG机器人并获取其\033[36mAPI TOKEN\033[0m"
url_tg=https://api.telegram.org/bot${TOKEN}/getUpdates echo "-----------------------------------------------"
read -p "请输入你获取到的API TOKEN > " TOKEN
top_box "请向\033[32m你申请的机器人\033[33m而不是BotFather\033[0m" echo "-----------------------------------------------"
echo -e "请向\033[32m你申请的机器人\033[33m而不是BotFather\033[0m"
url_tg=https://api.telegram.org/bot${TOKEN}/getUpdates
} }
public_bot() { public_bot() {
comp_box "请向机器人:\033[32;4mhttps://t.me/ShellCrashtg_bot\033[0m" echo -e "请向机器人:\033[32;4mhttps://t.me/ShellCrashtg_bot\033[0m"
TOKEN=publictoken TOKEN=publictoken
url_tg=https://tgbot.jwsc.eu.org/publictoken/getUpdates url_tg=https://tgbot.jwsc.eu.org/publictoken/getUpdates
} }
tg_push_token(){
tg_push_token() { push_TG="$TOKEN"
push_TG="$TOKEN" setconfig push_TG "$TOKEN"
setconfig push_TG "$TOKEN" setconfig chat_ID "$chat_ID"
setconfig chat_ID "$chat_ID"
. "$CRASHDIR"/libs/logger.sh && logger "已完成Telegram日志推送设置" 32 . "$CRASHDIR"/libs/logger.sh && logger "已完成Telegram日志推送设置" 32
} }
get_chatid(){
get_chatid() { i=1
i=1 chat_ID=''
chat_ID='' while [ $i -le 3 ] && [ -z "$chat_ID" ]; do
while [ $i -le 3 ] && [ -z "$chat_ID" ]; do sleep 1
sleep 1 echo -e "\033[33m第 $i 次尝试获取对话ID失败正在重试...\033[0m"
comp_box "\033[33m第 $i 次尝试获取对话ID失败正在重试...\033[0m" chat=$(web_get_lite "$url_tg" 2>/dev/null)
chat=$(web_get_lite "$url_tg" 2>/dev/null) if [ -n "$chat" ];then
if [ -n "$chat" ]; then chat_ID=$(echo $chat | sed 's/"update_id":/{\n"update_id":/g' | grep "$public_key" | head -n1 | grep -oE '"id":.*,"is_bot' | sed s'/"id"://' | sed s'/,"is_bot//')
chat_ID=$(echo "$chat" | sed 's/"update_id":/{\n"update_id":/g' | grep "$public_key" | head -n1 | grep -oE '"id":.*,"is_bot' | sed s'/"id"://' | sed s'/,"is_bot//') fi
fi i=$((i + 1))
i=$((i + 1)) done
done
} }
set_bot() { set_bot() {
public_key=$(cat /proc/sys/kernel/random/boot_id | sed 's/.*-//') public_key=$(cat /proc/sys/kernel/random/boot_id | sed 's/.*-//')
btm_box "发送此秘钥 \033[30;46m$public_key\033[0m" echo -e "发送此秘钥: \033[30;46m$public_key\033[0m"
read -r -p "我已经发送完成(1/0)> " res echo "-----------------------------------------------"
if [ "$res" = 1 ]; then read -p "我已经发送完成(1/0) > " res
get_chatid if [ "$res" = 1 ]; then
[ -z "$chat_ID" ] && [ "$TOKEN" != 'publictoken' ] && { get_chatid
comp_box "\033[31m无法获取对话ID请返回重新设置或手动输入ChatID\033[0m" \ [ -z "$chat_ID" ] && [ "$TOKEN" != 'publictoken' ] && {
"通常访问 \033[32;4m$url_tg\033[0m \n\033[36m即可看到ChatID\033[0m" echo -e "\033[31m无法获取对话ID请返回重新设置或手动输入ChatID\033[0m"
read -r -p "请手动输入ChatID> " chat_ID echo -e "通常访问 \033[32;4m$url_tg\033[0m \n\033[36m即可看到ChatID\033[0m"
} read -p "请手动输入ChatID > " chat_ID
if echo "$chat_ID" | grep -qE '^[0-9]{8,}$'; then }
return 0 if echo "$chat_ID" | grep -qE '^[0-9]{8,}$'; then
else return 0
msg_alert "\033[31m无法获取对话ID请重新配置\033[0m" else
return 1 echo -e "\033[31m无法获取对话ID请重新配置\033[0m"
fi sleep 1
fi return 1
fi
fi
} }

View File

@@ -1,17 +1,17 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
check_port() { check_port(){
if [ "$1" -gt 65535 ] || [ "$1" -le 1 ]; then if [ "$1" -gt 65535 -o "$1" -le 1 ]; then
msg_alert "\033[31m输入错误请输入正确的数值(1-65535)\033[0m" echo -e "\033[31m输入错误请输入正确的数值(1-65535)\033[0m"
return 1 return 1
elif echo "|$mix_port|$redir_port|$dns_port|$db_port|" | grep -q "|$1|"; then elif [ -n "$(echo "|$mix_port|$redir_port|$dns_port|$db_port|" | grep "|$1|")" ]; then
msg_alert "\033[31m输入错误请不要输入重复的端口\033[0m" echo -e "\033[31m输入错误请不要输入重复的端口\033[0m"
return 1 return 1
elif netstat -ntul | grep -q ":$1[[:space:]]"; then elif [ -n "$(netstat -ntul | grep -E ":$1[[:space:]]")" ]; then
msg_alert "\033[31m当前端口已被其他进程占用请重新输入\033[0m" echo -e "\033[31m当前端口已被其他进程占用请重新输入\033[0m"
return 1 return 1
else else
return 0 return 0
fi fi
} }

View File

@@ -1,87 +0,0 @@
msg_alert() {
# Default sleep time
_sleep_time=1
if [ "$1" = "-t" ] && [ -n "$2" ]; then
_sleep_time="$2"
shift 2
fi
line_break
separator_line "="
for line in "$@"; do
content_line "$line"
done
separator_line "="
sleep "$_sleep_time"
}
# complete box
comp_box() {
line_break
separator_line "="
for line in "$@"; do
content_line "$line"
done
separator_line "="
}
top_box() {
line_break
separator_line "="
for line in "$@"; do
content_line "$line"
done
}
# bottom box
btm_box() {
for line in "$@"; do
content_line "$line"
done
separator_line "="
}
list_box() {
i=1
printf '%s\n' "$1" | while IFS= read -r f; do
content_line "$i) $f$2"
i=$((i + 1))
done
}
common_success() {
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
}
common_failed() {
msg_alert "\033[32m$COMMON_FAILED\033[0m"
}
# =================================================
common_back() {
content_line "0) $COMMON_BACK"
separator_line "="
}
errornum() {
msg_alert "\033[31m$COMMON_ERR_NUM\033[0m"
}
error_letter() {
msg_alert "\033[31m$COMMON_ERR_LETTER\033[0m"
}
error_input() {
msg_alert "\033[31m$COMMON_ERR_INPUT\033[0m"
}
error_cancel() {
error_report "\033[31m$COMMON_ERR_CANCEL\033[0m"
}
cancel_back() {
separator_line "-"
content_line "$COMMON_CANCEL"
sleep 1
}

View File

@@ -1,14 +1,15 @@
#! /bin/bash #! /bin/bash
# Copyright (C) Juewuy # Copyright (C) Juewuy
ddns_menu() {
top_box "\033[30;46m欢迎使用DDNS\033[0m" ddns_menu(){
load_ddns echo -----------------------------------------------
echo -e "\033[30;46m欢迎使用DDNS\033[0m"
load_ddns
} }
add_ddns() { add_ddns() {
cat >>"$ddns_dir" <<EOF cat >>"$ddns_dir" <<EOF
config service '$service' config service '$service'
option enabled '1' option enabled '1'
option force_unit 'hours' option force_unit 'hours'
@@ -26,199 +27,157 @@ config service '$service'
option interface 'wan' option interface 'wan'
option bind_network 'wan' option bind_network 'wan'
EOF EOF
/usr/lib/ddns/dynamic_dns_updater.sh -S "$service" start >/dev/null 2>&1 & /usr/lib/ddns/dynamic_dns_updater.sh -S "$service" start >/dev/null 2>&1 &
sleep 3 sleep 3
msg_alert "服务已经添加!" echo 服务已经添加!
} }
set_ddns() { set_ddns() {
while true; do echo -----------------------------------------------
line_break read -p "请输入你的域名 > " str
read -r -p "请输入你的域名> " str [ -z "$str" ] && domain="$domain" || domain="$str"
[ -z "$str" ] && domain="$domain" || domain="$str" echo -----------------------------------------------
echo "" read -p "请输入用户名或邮箱 > " str
read -r -p "请输入用户名或邮箱> " str [ -z "$str" ] && username="$username" || username="$str"
[ -z "$str" ] && username="$username" || username="$str" echo -----------------------------------------------
echo "" read -p "请输入密码或令牌秘钥 > " str
read -r -p "请输入密码或令牌秘钥> " str [ -z "$str" ] && password="$password" || password="$str"
[ -z "$str" ] && password="$password" || password="$str" echo -----------------------------------------------
echo "" read -p "请输入检测更新间隔(单位:分钟;默认为10) > " check_interval
read -r -p "请输入检测更新间隔(单位:分钟默认为10)> " check_interval [ -z "$check_interval" ] || [ "$check_interval" -lt 1 -o "$check_interval" -gt 1440 ] && check_interval=10
[ -z "$check_interval" ] || [ "$check_interval" -lt 1 -o "$check_interval" -gt 1440 ] && check_interval=10 echo -----------------------------------------------
echo "" read -p "请输入强制更新间隔(单位:小时;默认为24) > " force_interval
read -r -p "请输入强制更新间隔(单位:小时默认为24)> " force_interval [ -z "$force_interval" ] || [ "$force_interval" -lt 1 -o "$force_interval" -gt 240 ] && force_interval=24
[ -z "$force_interval" ] || [ "$force_interval" -lt 1 -o "$force_interval" -gt 240 ] && force_interval=24 echo -----------------------------------------------
echo -e "请核对如下信息:"
comp_box "请核对如下信息:" \ echo -e "服务商: \033[32m$service\033[0m"
"" \ echo -e "域名: \033[32m$domain\033[0m"
"服务商 \033[32m$service\033[0m" \ echo -e "用户名 \033[32m$username\033[0m"
"域名: \033[32m$domain\033[0m" \ echo -e "检测间隔: \033[32m$check_interval\033[0m"
"用户名: \033[32m$username\033[0m" \ echo -----------------------------------------------
"检测间隔: \033[32m$check_interval\033[0m" read -p "确认添加?(1/0) > " res
btm_box "是否确认添加:" [ "$res" = 1 ] && add_ddns || set_ddns
btm_box "1) 是" \
"0) 否,重新輸入"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = 1 ]; then
add_ddns
break
fi
done
} }
set_ddns_service() { set_ddns_service() {
while true; do services_dir=/etc/ddns/"$serv"
services_dir=/etc/ddns/"$serv" [ -s "$services_dir" ] || services_dir=/etc/ddns/services
[ -s "$services_dir" ] || services_dir=/etc/ddns/services [ -s "$services_dir" ] || services_dir=/usr/share/ddns/list
[ -s "$services_dir" ] || services_dir=/usr/share/ddns/list [ -s "$services_dir" ] || {
[ -s "$services_dir" ] || { echo -e "\033[33m未找到DDNS列表文件尝试在线获取……\033[0m"
msg_alert "\033[33m未找到DDNS列表文件尝试在线获取……\033[0m" ddns service update >/dev/null || echo -e "\033[31m下载失败请重试\033[0m"
ddns service update >/dev/null || msg_alert "\033[31m下载失败请重试\033[0m" }
} echo -----------------------------------------------
comp_box "\033[32m请选择服务提供商\033[0m" echo -e "\033[32m请选择服务提供商\033[0m"
cat "$services_dir" | grep -vE '^#|^[[:space:]]*$' | awk '{print " "NR" " $1}'
list=$(awk '/^#/ || !NF {next} {print $1}' "$services_dir") nr=$(cat "$services_dir" | grep -vE '^#|^[[:space:]]*$' | wc -l)
list_box "$list" read -p "请输入对应数字 > " num
if [ -z "$num" ]; then
nr=$(echo "$list" | wc -l) i=
common_back elif [ "$num" -gt 0 -a "$num" -lt $nr ]; then
read -r -p "请输入对应数字> " num service_name=$(cat "$services_dir" | grep -vE '^#|^[[:space:]]*$' | awk '{print $1}' | sed -n "$num"p | sed 's/"//g')
if [ -z "$num" ] || [ "$num" = 0 ]; then service=$(echo $service_name | sed 's/\./_/g')
i= set_ddns
break else
elif [ "$num" -gt 0 ] && [ "$num" -lt "$nr" ]; then echo "输入错误,请重新输入!"
service_name=$(echo "$list" | sed -n "$num"p | sed 's/"//g') sleep 1
service=$(echo "$service_name" | sed 's/\./_/g') set_ddns_service
set_ddns fi
break
else
msg_alert "\033[33m输入错误请重新输入\033[0m"
fi
done
} }
set_ddns_type() { set_ddns_type() {
while true; do echo -----------------------------------------------
comp_box "\033[32m请选择网络模式\033[0m" echo -e "\033[32m请选择网络模式\033[0m"
btm_box "1) \033[36mIPV4\033[0m" \ echo -e " 1 \033[36mIPV4\033[0m"
"2) \033[36mIPV6\033[0m" \ echo -e " 2 \033[36mIPV6\033[0m"
"" \ read -p "请输入对应数字 > " num
"0) $COMMON_BACK" if [ -z "$num" ]; then
read -r -p "请输入对应数字> " num i=
case "$num" in elif [ "$num" = 1 ]; then
"" | 0) use_ipv6=0
break serv=services
;; set_ddns_service
1) elif [ "$num" = 2 ]; then
use_ipv6=0 use_ipv6=1
serv=services serv=services_ipv6
set_ddns_service set_ddns_service
break else
;; echo "输入错误,请重新输入!"
2) sleep 1
use_ipv6=1 set_ddns_type
serv=services_ipv6 fi
set_ddns_service
break
;;
*)
msg_alert "\033[33m输入错误请重新输入\033[0m"
;;
esac
done
} }
rev_ddns_service() { rev_ddns_service() {
while true; do enabled=$(uci get ddns."$service".enabled)
enabled=$(uci get ddns."$service".enabled) [ "$enabled" = 1 ] && enabled_b="停用" || enabled_b="启用"
[ "$enabled" = 1 ] && enabled_b="停用" || enabled_b="启用" echo -----------------------------------------------
comp_box "1) \033[32m立即更新\033[0m" \ echo -e " 1 \033[32m立即更新\033[0m"
"2) 编辑当前服务" \ echo -e " 2 编辑当前服务\033[0m"
"3) $enabled_b当前服务" \ echo -e " 3 $enabled_b当前服务"
"4) 移除当前服务" \ echo -e " 4 移除当前服务"
"5) 查看运行日志" \ echo -e " 5 查看运行日志"
"" \ echo -e " 0 返回上级菜单"
"0) 返回上级菜单" echo -----------------------------------------------
read -r -p "请输入对应数字> " num read -p "请输入对应数字 > " num
case "$num" in if [ -z "$num" -o "$num" = 0 ]; then
"" | 0) i=
break elif [ "$num" = 1 ]; then
;; /usr/lib/ddns/dynamic_dns_updater.sh -S $service start >/dev/null 2>&1 &
1) sleep 3
/usr/lib/ddns/dynamic_dns_updater.sh -S "$service" start >/dev/null 2>&1 & elif [ "$num" = 2 ]; then
sleep 3 domain=$(uci get ddns."$service".domain 2>/dev/null)
break username=$(uci get ddns."$service".username 2>/dev/null)
;; password=$(uci get ddns."$service".password 2>/dev/null)
2) service_name=$(uci get ddns."$service".service_name 2>/dev/null)
domain=$(uci get ddns."$service".domain 2>/dev/null) uci delete ddns."$service"
username=$(uci get ddns."$service".username 2>/dev/null) set_ddns
password=$(uci get ddns."$service".password 2>/dev/null) elif [ "$num" = 3 ]; then
service_name=$(uci get ddns."$service".service_name 2>/dev/null) [ "$enabled" = 1 ] && uci set ddns."$service".enabled='0' || uci set ddns."$service".enabled='1' && sleep 3
uci delete ddns."$service" uci commit ddns."$service"
set_ddns elif [ "$num" = 4 ]; then
break uci delete ddns."$service"
;; uci commit ddns."$service"
3) elif [ "$num" = 5 ]; then
[ "$enabled" = 1 ] && uci set ddns."$service".enabled='0' || uci set ddns."$service".enabled='1' && sleep 3 echo -----------------------------------------------
uci commit ddns."$service" cat /var/log/ddns/"$service".log 2>/dev/null
break sleep 1
;; fi
4) }
uci delete ddns."$service" load_ddns() {
uci commit ddns."$service" ddns_dir=/etc/config/ddns
break tmp_dir="$TMPDIR"/ddns
;; [ ! -f "$ddns_dir" ] && {
5) echo -e "\033[31m本脚本依赖OpenWrt内置的DDNS服务,当前设备无法运行,已退出!\033[0m"
line_break sleep 1
echo "===========================================================" return 1
cat /var/log/ddns/"$service".log 2>/dev/null }
echo "===========================================================" nr=0
break cat "$ddns_dir" | grep 'config service' | awk '{print $3}' | sed "s/'//g" | sed 's/"//g' >"$tmp_dir"
;; echo -----------------------------------------------
*) echo -e "列表 域名 启用 IP地址"
msg_alert "\033[33m输入错误请重新输入\033[0m" echo -----------------------------------------------
;; [ -s "$tmp_dir" ] && for service in $(cat "$tmp_dir"); do
esac #echo $service >>$tmp_dir
done nr=$((nr + 1))
enabled=$(uci get ddns."$service".enabled 2>/dev/null)
domain=$(uci get ddns."$service".domain 2>/dev/null)
local_ip=$(sed '1!G;h;$!d' /var/log/ddns/$service.log 2>/dev/null | grep -E 'Registered IP' | tail -1 | awk -F "'" '{print $2}' | tr -d "'\"")
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
set_ddns_type
load_ddns
elif [ "$num" -gt 0 -a "$num" -le $nr ]; then
service=$(cat $tmp_dir | sed -n "$num"p)
rev_ddns_service
load_ddns
else
echo "请输入正确数字!" && load_ddns
fi
rm -rf "$tmp_dir"
} }
load_ddns() {
while true; do
ddns_dir=/etc/config/ddns
tmp_dir="$TMPDIR"/ddns
[ ! -f "$ddns_dir" ] && {
btm_box "\033[31m本脚本依赖OpenWrt内置的DDNS服务,当前设备无法运行,已退出!\033[0m"
sleep 1
return 1
}
nr=0
cat "$ddns_dir" | grep 'config service' | awk '{print $3}' | sed "s/'//g" | sed 's/"//g' >"$tmp_dir"
separator_line "="
content_line " 列表 域名 启用 IP地址"
content_line ""
[ -s "$tmp_dir" ] && for service in $(cat "$tmp_dir"); do
# echo $service >>$tmp_dir
nr=$((nr + 1))
enabled=$(uci get ddns."$service".enabled 2>/dev/null)
domain=$(uci get ddns."$service".domain 2>/dev/null)
local_ip=$(sed '1!G;h;$!d' /var/log/ddns/"$service".log 2>/dev/null | grep -E 'Registered IP' | tail -1 | awk -F "'" '{print $2}' | tr -d "'\"")
content_line "$nr) $domain $enabled $local_ip"
done
content_line "$((nr + 1))) 添加DDNS服务"
content_line "0) 退出"
separator_line "="
read -r -p "请输入对应序号> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then
i=
rm -rf "$tmp_dir"
break
elif [ "$num" -gt $nr ]; then
set_ddns_type
elif [ "$num" -gt 0 ] && [ "$num" -le $nr ]; then
service=$(cat "$tmp_dir" | sed -n "$num"p)
rev_ddns_service
else
msg_alert "\033[33m请输入正确数字\033[0m"
fi
done
}

View File

@@ -4,392 +4,231 @@
[ -n "$__IS_MODULE_DNS_LOADED" ] && return [ -n "$__IS_MODULE_DNS_LOADED" ] && return
__IS_MODULE_DNS_LOADED=1 __IS_MODULE_DNS_LOADED=1
load_lang dns set_dns_mod() { #DNS模式设置
[ -z "$hosts_opt" ] && hosts_opt=ON
# DNS 模式设置 [ -z "$dns_protect" ] && dns_protect=ON
set_dns_mod() { [ -z "$ecs_subnet" ] && ecs_subnet=OFF
while true; do echo "-----------------------------------------------"
[ -z "$hosts_opt" ] && hosts_opt=ON echo -e "当前DNS运行模式为\033[47;30m $dns_mod \033[0m"
[ -z "$dns_protect" ] && dns_protect=ON echo -e "\033[33m切换模式后需要手动重启服务以生效\033[0m"
[ -z "$ecs_subnet" ] && ecs_subnet=OFF echo "-----------------------------------------------"
comp_box "$DNS_CURRENT_MODE\033[47;30m $dns_mod \033[0m" \ echo -e " 1 MIX模式 \033[32mCN域名realip其他fake-ip分流\033[0m"
"\033[33m$DNS_RESTART_NOTICE\033[0m" echo -e " 2 Route模式\033[32mCN域名realip其他dns2proxy分流\033[0m"
content_line "1) 设为MIX$COMMON_MOD\t\033[32m$DNS_MODE_MIX_DESC\033[0m" echo -e " 3 Redir模式\033[33m不安全,需搭配第三方DNS服务使用\033[0m"
content_line "2) 设为Route$COMMON_MOD\t\033[32m$DNS_MODE_ROUTE_DESC\033[0m" echo "-----------------------------------------------"
content_line "3) 设为Redir$COMMON_MOD\t\033[33m$DNS_MODE_REDIR_DESC\033[0m" echo -e " 4 DNS防泄漏 \033[36m$dns_protect\033[0m ———启用时少量网站可能连接卡顿"
content_line "" echo -e " 5 Hosts优化 \033[36m$hosts_opt\033[0m ———调用本机hosts并劫持NTP服务"
content_line "4) $DNS_MENU_PROTECT\t \033[36m$dns_protect\033[0m\t$DNS_PROTECT_DESC" echo -e " 6 ECS优化 \033[36m$ecs_subnet\033[0m ———解决CDN下载浪费流量等问题"
content_line "5) $DNS_MENU_HOSTS\t \033[36m$hosts_opt\033[0m\t$DNS_HOSTS_DESC" echo -e " 7 DNS劫持端口\033[36m$dns_redir_port\033[0m ———用于兼容第三方DNS服务"
content_line "6) $DNS_MENU_ECS\t \033[36m$ecs_subnet\033[0m\t$DNS_ECS_DESC" [ "$dns_mod" = "mix" ] &&
content_line "7) $DNS_MENU_REDIR\033[36m$dns_redir_port\033[0m\t$DNS_REDIR_PORT_DESC" echo -e " 8 管理MIX模式\033[33mFake-ip过滤列表\033[0m"
[ "$dns_mod" = "mix" ] && echo -e " 9 修改\033[36mDNS服务器\033[0m"
content_line "8) \033[33m$DNS_FAKEIP_MENU\033[0m" echo "-----------------------------------------------"
content_line "9) \033[36m$DNS_ADV_MENU\033[0m" echo " 0 返回上级菜单"
content_line "" read -p "请输入对应数字 > " num
content_line "0) $COMMON_BACK" case "$num" in
separator_line "=" 0) ;;
read -r -p "$COMMON_INPUT> " num 1)
case "$num" in if echo "$crashcore" | grep -q 'singbox' || [ "$crashcore" = meta ]; then
"" | 0) dns_mod=mix
break setconfig dns_mod $dns_mod
;; echo "-----------------------------------------------"
1 | 2) echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m"
if echo "$crashcore" | grep -q 'singbox' || [ "$crashcore" = meta ]; then
[ "$num" = 1 ] && dns_mod=mix || dns_mod=route
setconfig dns_mod "$dns_mod"
msg_alert "\033[36m$DNS_SET_OK$dns_mod\033[0m"
else
msg_alert "\033[31m$DNS_CORE_UNSUPPORTED\033[0m"
fi
;;
3)
dns_mod=redir_host
setconfig dns_mod "$dns_mod"
msg_alert "\033[36m$DNS_SET_OK$dns_mod\033[0m"
;;
4)
while true; do
line_break
separator_line "="
if [ "$dns_protect" = ON ]; then
content_line "当前\033[33m已启用\033[0mDNS防泄漏是否确认禁用"
else
content_line "当前\033[33m已禁用\033[0mDNS防泄漏是否确认启用"
fi
separator_line "="
btm_box "1) 是" \
"2) 重置为默认值" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " num
case "$num" in
0)
break
;;
1)
if [ "$dns_protect" = ON ]; then
dns_protect=OFF
else
dns_protect=ON
fi
;;
2)
dns_protect=ON
;;
*)
errornum
continue
;;
esac
setconfig dns_protect "$dns_protect"
common_success
done
;;
5)
while true; do
line_break
separator_line "="
if [ "$hosts_opt" = ON ]; then
content_line "当前\033[33m已启用\033[0mHosts优化是否确认禁用"
else
content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用"
fi
separator_line "="
btm_box "1) 是" \
"2) 重置为默认值" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " num
case "$num" in
0)
break
;;
1)
if [ "$hosts_opt" = ON ]; then
hosts_opt=OFF
else
hosts_opt=ON
fi
;;
2)
hosts_opt=ON
;;
*)
errornum
continue
;;
esac
setconfig dns_protect "$hosts_opt"
common_success
done
;;
6)
while true; do
line_break
separator_line "="
if [ "$ecs_subnet" = ON ]; then
content_line "当前\033[33m已启用\033[0mHosts优化是否确认禁用"
else
content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用"
fi
separator_line "="
btm_box "1) 是" \
"2) 重置为默认值" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " num
case "$num" in
0)
break
;;
1)
if [ "$ecs_subnet" = ON ]; then
ecs_subnet=OFF
else
ecs_subnet=ON
fi
;;
2)
ecs_subnet=OFF
;;
*)
errornum
continue
;;
esac
setconfig dns_protect "$ecs_subnet"
common_success
done
;;
7)
while true; do
comp_box "\033[31m$DNS_REDIR_WARN\033[0m" \
"\033[33m$DNS_REDIR_HINT 127.0.0.1:$dns_port\033[0m" \
"" \
"\033[36m请直接输入旁路由IPV4地址\033[0m" \
"或输入 r 重置DNS劫持端口" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " num
case "$num" in
0)
break
;;
r)
dns_redir_port="$dns_port"
setconfig dns_redir_port
common_success
break
;;
*)
if [ "$num" -ge 1 ] && [ "$num" -lt 65535 ]; then
if ckcmd netstat && netstat -ntul | grep -q ":$num "; then
dns_redir_port="$num"
setconfig dns_redir_port "$dns_redir_port"
common_success
break
else
msg_alert
fi
else
errornum
fi
;;
esac
done
;;
8)
fake_ip_filter
;;
9)
set_dns_adv
;;
*)
errornum
;;
esac
done
}
fake_ip_filter() {
while true; do
comp_box "\033[32m$DNS_FAKEIP_DESC\033[0m" \
"\033[31m$DNS_FAKEIP_TIP\033[0m" \
"\033[36m$DNS_FAKEIP_EXAMPLE\033[0m"
if [ -s "$CRASHDIR/configs/fake_ip_filter" ]; then
content_line "\033[33m$DNS_FAKEIP_EXIST\033[0m"
content_line ""
awk '{print NR") "$1}' "$CRASHDIR/configs/fake_ip_filter" |
while IFS= read -r line; do
content_line "$line"
done
else else
content_line "\033[33m$DNS_FAKEIP_EMPTY\033[0m" echo -e "\033[31m当前内核不支持的功能\033[0m"
sleep 1
fi fi
btm_box "" \ set_dns_mod
"0) 返回上级菜单" ;;
read -r -p "$DNS_FAKEIP_EDIT> " input 2)
case "$input" in if echo "$crashcore" | grep -q 'singbox' || [ "$crashcore" = meta ]; then
"" | 0) dns_mod=route
break setconfig dns_mod $dns_mod
;; echo "-----------------------------------------------"
*) echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m"
if [ "$input" -ge 1 ] 2>/dev/null; then else
if sed -i "${input}d" "$CRASHDIR/configs/fake_ip_filter"; then echo -e "\033[31m当前内核不支持的功能\033[0m"
msg_alert "\033[32m移除成功\033[0m" sleep 1
else fi
msg_alert "\033[31m移除失败\033[0m" set_dns_mod
fi ;;
else 3)
comp_box "请确认需要添加的地址:\033[32m$input\033[0m" dns_mod=redir_host
btm_box "1) 确认无误" \ setconfig dns_mod $dns_mod
"0) 返回上级菜单" echo "-----------------------------------------------"
read -r -p "$COMMON_INPUT>" res echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m"
if [ "$res" = 1 ]; then set_dns_mod
if echo "$input" >>"$CRASHDIR/configs/fake_ip_filter"; then ;;
msg_alert "\033[32m添加成功\033[0m" 4)
else [ "$dns_protect" = "ON" ] && dns_protect=OFF || dns_protect=ON
msg_alert "\033[31m添加失败\033[0m" setconfig dns_protect $dns_protect
fi set_dns_mod
else ;;
break 5)
fi [ "$hosts_opt" = "ON" ] && hosts_opt=OFF || hosts_opt=ON
fi setconfig hosts_opt $hosts_opt
;; set_dns_mod
esac ;;
done 6)
[ "$ecs_subnet" = "ON" ] && ecs_subnet=OFF || ecs_subnet=ON
setconfig ecs_subnet "$ecs_subnet"
set_dns_mod
;;
7)
echo "-----------------------------------------------"
echo -e "\033[31m仅限搭配第三方DNS服务(AdGuard、SmartDNS……)使用!\033[0m"
echo -e "\033[33m设置为第三方DNS服务的监听端口即可修改防火墙劫持\n建议在第三方DNS服务中将上游DNS指向【localhost:$dns_port】\033[0m"
echo "-----------------------------------------------"
read -p "请输入第三方DNS服务的监听端口(0重置端口) > " num
if [ "$num" = 0 ];then
dns_redir_port="$dns_port"
setconfig dns_redir_port
elif [ "$num" -lt 65535 -a "$num" -ge 1 ];then
if ckcmd netstat;then
port_test=$(netstat -ntul | grep -E ":$num[[:space:]]")
else
port_test=0
fi
if [ -n "$port_test" ];then
dns_redir_port="$num"
setconfig dns_redir_port "$dns_redir_port"
else
echo -e "\033[33m此端口未检测到已运行的DNS服务\033[0m"
fi
else
errornum
fi
sleep 1
set_dns_mod
;;
8)
echo "-----------------------------------------------"
fake_ip_filter
set_dns_mod
;;
9)
set_dns_adv
set_dns_mod
;;
*)
errornum
;;
esac
} }
fake_ip_filter() {
# DNS详细设置 echo -e "\033[32m用于解决Fake-ip模式下部分地址或应用无法连接的问题\033[0m"
set_dns_adv() { echo -e "\033[31m脚本已经内置了大量地址你只需要添加出现问题的地址\033[0m"
while true; do echo -e "\033[36m示例a.b.com"
comp_box "\033[31m$DNS_ADV_SINGBOX_LIMIT\033[0m" \ echo -e "示例:*.b.com"
"$DNS_ADV_SPLIT" \ echo -e "示例:*.*.b.com\033[0m"
"\033[33m$DNS_ADV_CERT\033[0m" \ echo "-----------------------------------------------"
"" \ if [ -s ${CRASHDIR}/configs/fake_ip_filter ]; then
"DIRECT-DNS" \ echo -e "\033[33m已添加Fake-ip过滤地址\033[0m"
"\033[32m$dns_nameserver\033[0m" \ cat ${CRASHDIR}/configs/fake_ip_filter | awk '{print NR" "$1}'
"" \ else
"PROXY-DNS" \ echo -e "\033[33m你还未添加Fake-ip过滤地址\033[0m"
"\033[36m$dns_fallback\033[0m" \ fi
"" \ echo "-----------------------------------------------"
"DEFAULT-DNS" \ echo -e "\033[32m输入数字直接移除对应地址输入地址直接添加\033[0m"
"\033[33m$dns_resolver\033[0m" \ read -p "请输入数字或地址 > " input
"" case "$input" in
btm_box "1) $DNS_ADV_EDIT_DIRECT" \ 0) ;;
"2) $DNS_ADV_EDIT_PROXY" \ '') ;;
"3) $DNS_ADV_EDIT_DEFAULT" \ *)
"4) \033[32m$DNS_ADV_AUTO_ENCRYPT\033[0m" \ if [ $input -ge 1 ] 2>/dev/null; then
"9) \033[33m$DNS_ADV_RESET\033[0m" \ sed -i "${input}d" ${CRASHDIR}/configs/fake_ip_filter 2>/dev/null
"" \ echo -e "\033[32m移除成功\033[0m"
"0) $COMMON_BACK" else
read -r -p "$COMMON_INPUT> " num echo -e "你输入的地址是:\033[32m$input\033[0m"
case "$num" in read -p "确认添加?(1/0) > " res
"" | 0) [ "$res" = 1 ] && echo $input >>${CRASHDIR}/configs/fake_ip_filter
break fi
;; sleep 1
1) fake_ip_filter
comp_box "当前DIRECT-DNS\033[32m$dns_nameserver\033[0m" ;;
btm_box "\033[36m请直接输入新的DIRECT-DNS地址\033[0m" \ esac
"或输入 r 重置DIRECT-DNS地址" \ }
"或输入 0 返回上级菜单" set_dns_adv() { #DNS详细设置
read -r -p "请输入> " res echo "-----------------------------------------------"
case "$res" in echo -e "当前基础DNS\033[32m$dns_nameserver\033[0m"
0) echo -e "PROXY-DNS\033[36m$dns_fallback\033[0m"
continue echo -e "解析DNS\033[33m$dns_resolver\033[0m"
;; echo -e "多个DNS地址请用\033[30;47m“|”\033[0m或者\033[30;47m“, ”\033[0m分隔输入"
r) echo -e "\033[33m必须拥有本地根证书文件才能使用dot/doh类型的加密dns\033[0m"
dns_nameserver="127.0.0.1" echo -e "\033[31m注意singbox内核只有首个dns会被加载\033[0m"
setconfig dns_nameserver "'$dns_nameserver'" echo "-----------------------------------------------"
common_success echo -e " 1 修改\033[32m基础DNS\033[0m"
;; echo -e " 2 修改\033[36mPROXY-DNS\033[0m(该DNS查询会经过节点)"
*) echo -e " 3 修改\033[33m解析DNS\033[0m(必须是IP,用于解析其他DNS)"
dns_nameserver=$(echo "$res" | sed 's#|#,\ #g') echo -e " 4 一键配置\033[32m加密DNS\033[0m"
if [ -n "$dns_nameserver" ]; then echo -e " 9 \033[33m重置\033[0m默认DNS配置"
setconfig dns_nameserver "'$dns_nameserver'" echo -e " 0 返回上级菜单"
common_success echo "-----------------------------------------------"
else read -p "请输入对应数字 > " num
common_failed case "$num" in
fi 0) ;;
;; 1)
esac read -p "请输入新的DNS > " dns_nameserver
;; dns_nameserver=$(echo $dns_nameserver | sed 's#|#\,\ #g')
2) if [ -n "$dns_nameserver" ]; then
comp_box "当前PROXY-DNS\033[32m$dns_fallback\033[0m" setconfig dns_nameserver "'$dns_nameserver'"
btm_box "\033[36m请直接输入新的PROXY-DNS地址\033[0m" \ echo -e "\033[32m设置成功\033[0m"
"或输入 r 重置PROXY-DNS地址" \ fi
"或输入 0 返回上级菜单" sleep 1
read -r -p "请输入> " res set_dns_adv
case "$res" in ;;
0) 2)
continue read -p "请输入新的DNS > " dns_fallback
;; dns_fallback=$(echo $dns_fallback | sed 's/|/\,\ /g')
r) if [ -n "$dns_fallback" ]; then
dns_fallback="1.1.1.1, 8.8.8.8" setconfig dns_fallback "'$dns_fallback'"
setconfig dns_fallback "'$dns_fallback'" echo -e "\033[32m设置成功\033[0m"
common_success fi
;; sleep 1
*) set_dns_adv
dns_fallback=$(echo "$res" | sed 's#|#,\ #g') ;;
if [ -n "$dns_fallback" ]; then 3)
setconfig dns_fallback "'$dns_fallback'" read -p "请输入新的DNS > " text
common_success if echo "$text" | grep -qE '://.*::'; then
else echo -e "\033[31m此选项暂不支持ipv6加密DNS\033[0m"
common_failed elif [ -n "$text" ]; then
fi dns_resolver=$(echo $text | sed 's/|/\,\ /g')
;; setconfig dns_resolver "'$dns_resolver'"
esac echo -e "\033[32m设置成功\033[0m"
;; fi
3) sleep 1
comp_box "当前DEFAULT-DNS\033[32m$dns_resolver\033[0m" set_dns_adv
btm_box "\033[36m请直接输入新的DEFAULT-DNS地址\033[0m" \ ;;
"或输入 r 重置DEFAULT-DNS地址" \ 4)
"或输入 0 返回上级菜单" echo "-----------------------------------------------"
separator_line "=" openssldir="$(openssl version -d 2>&1 | awk -F '"' '{print $2}')"
read -r -p "请输入> " res if [ -s "$openssldir/certs/ca-certificates.crt" ] || [ -s "/etc/ssl/certs/ca-certificates.crt" ] ||
case "$res" in echo "$crashcore" | grep -qE 'meta|singbox'; then
0) dns_nameserver='https://dns.alidns.com/dns-query, https://doh.pub/dns-query'
continue dns_fallback='https://cloudflare-dns.com/dns-query, https://dns.google/dns-query, https://doh.opendns.com/dns-query'
;; dns_resolver='https://223.5.5.5/dns-query, 2400:3200::1'
"r") setconfig dns_nameserver "'$dns_nameserver'"
dns_resolver="223.5.5.5, 2400:3200::1" setconfig dns_fallback "'$dns_fallback'"
setconfig dns_resolver "'$dns_resolver'" setconfig dns_resolver "'$dns_resolver'"
common_failed echo -e "\033[32m已设置加密DNS如出现DNS解析问题请尝试重置DNS配置\033[0m"
;; else
*) echo -e "\033[31m找不到根证书文件无法启用加密DNSLinux系统请自行搜索安装OpenSSL的方式\033[0m"
if echo "$res" | grep -qE '://.*::'; then fi
msg_alert "\033[31m$DNS_IPV6_NOT_SUPPORT\033[0m" sleep 1
else set_dns_adv
dns_resolver=$(echo "$res" | sed 's#|#,\ #g') ;;
setconfig dns_resolver "'$dns_resolver'" 9)
msg_alert "\033[32m$COMMON_SUCCESS\033[0m" setconfig dns_nameserver
fi setconfig dns_fallback
;; setconfig dns_resolver
esac . "$CRASHDIR"/libs/get_config.sh
;; echo -e "\033[33mDNS配置已重置\033[0m"
4) sleep 1
line_break set_dns_adv
separator_line "=" ;;
if echo "$crashcore" | grep -qE 'meta|singbox'; then *)
dns_nameserver='https://dns.alidns.com/dns-query, https://doh.pub/dns-query' errornum
dns_fallback='https://cloudflare-dns.com/dns-query, https://dns.google/dns-query, https://doh.opendns.com/dns-query' sleep 1
dns_resolver='https://223.5.5.5/dns-query, 2400:3200::1' ;;
setconfig dns_nameserver "'$dns_nameserver'" esac
setconfig dns_fallback "'$dns_fallback'"
setconfig dns_resolver "'$dns_resolver'"
content_line "\033[32m$DNS_ENCRYPT_OK\033[0m"
else
content_line "\033[31m$DNS_CORE_REQUIRE\033[0m"
fi
separator_line "="
;;
9)
setconfig dns_nameserver
setconfig dns_fallback
setconfig dns_resolver
. "$CRASHDIR/libs/get_config.sh"
common_success
;;
*)
errornum
;;
esac
done
} }

View File

@@ -1,502 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_MODULE_FW_FILTER_LOADED" ] && return
__IS_MODULE_FW_FILTER_LOADED=1
# 流量过滤
set_fw_filter() {
while true; do
[ -z "$common_ports" ] && common_ports=ON
[ -z "$quic_rj" ] && quic_rj=OFF
[ -z "$cn_ip_route" ] && cn_ip_route=OFF
touch "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter
[ -z "$(cat "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter 2>/dev/null)" ] && mac_return=OFF || mac_return=ON
comp_box "1) 过滤非常用端口: \033[36m$common_ports\033[0m ———用于过滤P2P流量" \
"2) 过滤局域网设备: \033[36m$mac_return\033[0m ———使用黑/白名单进行过滤" \
"3) 过滤QUIC协议 \033[36m$quic_rj\033[0m ———优化视频性能" \
"4) 过滤CN_IP(4&6)列表:\033[36m$cn_ip_route\033[0m ———优化性能" \
"5) 自定义透明路由ipv4网段适合vlan等复杂网络环境" \
"6) 自定义保留地址ipv4网段需要以保留地址为访问目标的环境" \
"" \
"0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num
case "$num" in
"" | 0)
break
;;
1)
if [ -n "$(pidof CrashCore)" ] && [ "$firewall_mod" = 'iptables' ]; then
comp_box "切换时将停止服务,是否继续:"
btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && "$CRASHDIR"/start.sh stop && set_common_ports
else
set_common_ports
fi
;;
2)
checkcfg_mac=$(cat "$CRASHDIR"/configs/mac)
fw_filter_lan
if [ -n "$PID" ]; then
checkcfg_mac_new=$(cat "$CRASHDIR"/configs/mac)
[ "$checkcfg_mac" != "$checkcfg_mac_new" ] && checkrestart
fi
;;
3)
if [ "$quic_rj" = "OFF" ]; then
quic_rj=ON
msg_alert "\033[33m已禁止QUIC流量通过ShellCrash内核\033[0m"
else
quic_rj=OFF
msg_alert "\033[33m已取消禁止QUIC协议流量\033[0m"
fi
setconfig quic_rj $quic_rj
;;
4)
if [ -n "$(ipset -v 2>/dev/null)" ] || [ "$firewall_mod" = 'nftables' ]; then
if [ "$cn_ip_route" = "OFF" ]; then
cn_ip_route=ON
msg_alert -t 2 "\033[32m已开启CN_IP绕过内核功能\033[0m" \
"\033[31m注意此功能会导致全局模式及一切CN相关规则失效\033[0m"
else
cn_ip_route=OFF
msg_alert "\033[33m已禁用CN_IP绕过内核功能\033[0m"
fi
setconfig cn_ip_route $cn_ip_route
else
msg_alert "\033[31m当前设备缺少ipset模块或未使用nftables模式无法启用绕过功能\033[0m"
fi
;;
5)
set_cust_host_ipv4
;;
6)
set_reserve_ipv4
;;
*)
errornum
;;
esac
done
}
set_common_ports() {
while true; do
[ -z "$multiport" ] && multiport='22,80,443,8080,8443'
line_break
separator_line "="
content_line "\033[31m注意\n\033[0mMIX模式下所有fake-ip来源的非常用端口流量不会被过滤"
if [ -n "$common_ports" ]; then
content_line ""
content_line "当前已放行端口:\033[36m$multiport\033[0m"
fi
separator_line "="
btm_box "1) 启用/关闭端口过滤: \033[36m$common_ports\033[0m" \
"2) 添加放行端口" \
"3) 移除指定放行端口" \
"4) 重置默认放行端口" \
"5) 重置为旧版放行端口" \
"" \
"0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num
case "$num" in
"" | 0)
break
;;
1)
if [ "$common_ports" = ON ]; then
common_ports=OFF
else
common_ports=ON
fi
if setconfig common_ports "$common_ports"; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
2)
while true; do
port_count=$(echo "$multiport" | awk -F',' '{print NF}')
if [ "$port_count" -ge 15 ]; then
comp_box "\033[31m最多支持设置放行15个端口请先减少一些\033[0m"
else
comp_box "当前已放行端口:\033[36m$multiport\033[0m"
btm_box "\033[36m请直接输入要放行的端口号\033[0m\n每次只能输入一个端口号切勿一次添加多个端口号" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " port
if [ "$port" = 0 ]; then
break
elif echo ",$multiport," | grep -q ",$port,"; then
msg_alert "\033[31m输入错误请勿重复添加\033[0m"
elif [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
msg_alert "\033[31m输入错误请输入正确的数值165535\033[0m"
else
multiport=$(echo "$multiport,$port" | sed "s/^,//")
if setconfig multiport "$multiport"; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
fi
fi
done
;;
3)
while true; do
comp_box "当前已放行端口:\033[36m$multiport\033[0m"
btm_box "\033[36m请直接输入要移除的端口号\033[0m\n每次只能输入一个端口号切勿一次添加多个端口号" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " port
if [ "$port" = 0 ]; then
break
elif echo ",$multiport," | grep -q ",$port,"; then
if [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
msg_alert "\033[31m输入错误请输入正确的数值165535\033[0m"
else
multiport=$(echo ",$multiport," | sed "s/,$port//; s/^,//; s/,$//")
if setconfig multiport "$multiport"; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
fi
else
msg_alert "\033[31m输入错误请输入已添加过的端口\033[0m"
fi
done
;;
4)
multiport=''
if setconfig multiport; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
5)
multiport='22,80,143,194,443,465,587,853,993,995,5222,8080,8443'
if setconfig multiport "$multiport"; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
*)
errornum
;;
esac
done
}
# 自定义ipv4透明路由、保留地址网段
set_cust_host_ipv4() {
while true; do
[ -z "$replace_default_host_ipv4" ] && replace_default_host_ipv4="OFF"
. "$CRASHDIR"/starts/fw_getlanip.sh && getlanip
comp_box "当前默认透明路由的网段为:\033[32m$host_ipv4\033[0m" \
"当前已添加的自定义网段为:\033[36m$cust_host_ipv4\033[0m"
btm_box "1) 移除所有自定义网段" \
"2) 使用自定义网段覆盖默认网段 \033[36m$replace_default_host_ipv4\033[0m" \
"" \
"0) $COMMON_BACK"
read -r -p "请输入对应的序号或需要额外添加的网段> " text
case "$text" in
"" | 0)
break
;;
1)
unset cust_host_ipv4
if setconfig cust_host_ipv4; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
2)
if [ "$replace_default_host_ipv4" = "OFF" ]; then
replace_default_host_ipv4="ON"
else
replace_default_host_ipv4="OFF"
fi
if setconfig replace_default_host_ipv4 "$replace_default_host_ipv4"; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
*)
if echo "$text" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}' && [ -z "$(echo $cust_host_ipv4 | grep "$text")" ]; then
cust_host_ipv4="$cust_host_ipv4 $text"
if setconfig cust_host_ipv4 "'$cust_host_ipv4'"; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
else
msg_alert "\033[31m请输入正确的网段地址\033[0m"
fi
;;
esac
done
}
set_reserve_ipv4() {
while true; do
[ -z "$reserve_ipv4" ] && reserve_ipv4="0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 100.64.0.0/10 169.254.0.0/16 172.16.0.0/12 192.168.0.0/16 224.0.0.0/4 240.0.0.0/4"
comp_box "\033[33m注意地址必须是空格分隔错误的设置可能导致网络回环或启动报错请务必谨慎\033[0m" \
"" \
"当前网段:" \
"\033[36m$reserve_ipv4\033[0m"
btm_box "\033[36m请直接输入自定义保留地址ipv4网段\033[0m" \
"或输入 1 重置默认网段" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
case "$text" in
"" | 0)
break
;;
1)
unset reserve_ipv4
if setconfig reserve_ipv4; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
*)
if echo "$text" | grep -Eq "(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])/(3[0-2]|[1-2]?[0-9]))( +|$)+"; then
reserve_ipv4="$text"
if setconfig reserve_ipv4 "'$reserve_ipv4'"; then
msg_alert "已将保留地址网段设为:\033[32m$reserve_ipv4\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
else
msg_alert "\033[31m输入有误请重新输入\033[0m"
fi
;;
esac
done
}
# 局域网设备过滤
fw_filter_lan() {
get_devinfo() {
dev_ip=$(cat "$dhcpdir" | grep " $dev " | awk '{print $3}') && [ -z "$dev_ip" ] && dev_ip=$dev
dev_mac=$(cat "$dhcpdir" | grep " $dev " | awk '{print $2}') && [ -z "$dev_mac" ] && dev_mac=$dev
dev_name=$(cat "$dhcpdir" | grep " $dev " | awk '{print $4}') && [ -z "$dev_name" ] && dev_name='未知设备'
}
add_mac() {
while true; do
comp_box "手动输入mac地址时仅支持\033[32mxx:xx:xx:xx:xx:xx\033[0m的形式"
content_line "已添加的mac地址"
content_line ""
if [ -s "$CRASHDIR/configs/mac" ]; then
while IFS= read -r line; do
content_line "$line"
done <"$CRASHDIR/configs/mac"
else
content_line "暫未添加任何mac地址"
fi
separator_line "="
content_line "序号 \033[33m设备IP 设备mac地址 设备名称\033[0m"
if [ -s "$dhcpdir" ]; then
awk '{print NR") "$3,$2,$4}' "$dhcpdir" |
while IFS= read -r line; do
content_line "$line"
done
else
content_line "无纪录"
fi
btm_box "" \
"0) $COMMON_BACK"
read -r -p "请输入对应序号或直接输入mac地址> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then
i=
break
elif echo "$num" | grep -aEq '^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$'; then
if [ -z "$(cat "$CRASHDIR"/configs/mac | grep -E "$num")" ]; then
echo "$num" | grep -oE '^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$' >>"$CRASHDIR"/configs/mac
else
msg_alert "\033[31m已添加的设备请勿重复添加\033[0m"
fi
elif [ "$num" -le $(cat $dhcpdir 2>/dev/null | awk 'END{print NR}') ]; then
macadd=$(cat "$dhcpdir" | awk '{print $2}' | sed -n "$num"p)
if [ -z "$(cat "$CRASHDIR"/configs/mac | grep -E "$macadd")" ]; then
echo "$macadd" >>"$CRASHDIR"/configs/mac
else
msg_alert "\033[31m已添加的设备请勿重复添加\033[0m"
fi
else
msg_alert "\033[31m输入有误请重新输入\033[0m"
fi
done
}
add_ip() {
while true; do
comp_box "手动输入时仅支持 \033[32m192.168.1.0/24\033[0m 或 \033[32m192.168.1.0\033[0m 的形式" \
"不支持ipv6地址过滤可能导致过滤失败建议使用mac地址过滤"
content_line "已添加的IP地址"
content_line ""
if [ -s "$CRASHDIR/configs/ip_filter" ]; then
while IFS= read -r line; do
content_line "$line"
done <"$CRASHDIR/configs/ip_filter"
else
content_line "暫未添加任何IP地址"
fi
separator_line "="
content_line "\033[33m序号 设备IP 设备名称\033[32m"
if [ -s "$dhcpdir" ]; then
awk '{print NR") "$3, $4}' "$dhcpdir" |
while IFS= read -r line; do
content_line "$line"
done
else
content_line "无纪录"
fi
btm_box "" \
"0) $COMMON_BACK"
read -r -p "请输入对应序号或直接输入IP地址段> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then
i=
break
elif echo "$num" | grep -aEq '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|[12]?[0-9]))?$'; then
if [ -z "$(cat "$CRASHDIR"/configs/ip_filter | grep -E "$num")" ]; then
echo "$num" | grep -oE '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|[12]?[0-9]))?$' >>"$CRASHDIR"/configs/ip_filter
else
msg_alert "\033[31m已添加的地址请勿重复添加\033[0m"
fi
elif [ "$num" -le "$(cat "$dhcpdir" 2>/dev/null | awk 'END{print NR}')" ]; then
ipadd=$(cat "$dhcpdir" | awk '{print $3}' | sed -n "$num"p)
if [ -z "$(cat "$CRASHDIR"/configs/mac | grep -E "$ipadd")" ]; then
echo "$ipadd" >>"$CRASHDIR"/configs/ip_filter
else
msg_alert "\033[31m已添加的地址请勿重复添加\033[0m"
fi
else
msg_alert "\033[31m输入有误请重新输入\033[0m"
fi
done
}
del_all() {
while true; do
if [ -z "$(cat "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter 2>/dev/null)" ]; then
msg_alert "\033[31m列表中没有需要移除的设备\033[0m"
break
else
comp_box "请选择需要移除的设备:"
content_line " \033[32m设备IP \033[36m设备mac地址 \033[35m设备名称\033[0m"
i=1
for dev in $(cat "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter 2>/dev/null); do
get_devinfo
content_line "$(printf "%s) \033[32m%-18s \033[36m%-18s \033[35m%s\033[0m" \
"$i" "$dev_ip" "$dev_mac" "$dev_name")"
i=$((i + 1))
done
btm_box "" \
"0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num
mac_filter_rows=$(cat "$CRASHDIR"/configs/mac 2>/dev/null | wc -l)
ip_filter_rows=$(cat "$CRASHDIR"/configs/ip_filter 2>/dev/null | wc -l)
if [ -z "$num" ] || [ "$num" -le 0 ]; then
n=
break
elif [ "$num" -le "$mac_filter_rows" ]; then
sed -i "${num}d" "$CRASHDIR"/configs/mac
msg_alert "\033[32m对应设备已移除\033[0m"
elif [ "$num" -le $((mac_filter_rows + ip_filter_rows)) ]; then
num=$((num - mac_filter_rows))
sed -i "${num}d" "$CRASHDIR"/configs/ip_filter
msg_alert "\033[32m对应设备已移除\033[0m"
else
msg_alert "\033[31m输入有误请重新输入\033[0m"
fi
fi
done
}
while true; do
[ -z "$dhcpdir" ] && [ -f /var/lib/dhcp/dhcpd.leases ] && dhcpdir='/var/lib/dhcp/dhcpd.leases'
[ -z "$dhcpdir" ] && [ -f /var/lib/dhcpd/dhcpd.leases ] && dhcpdir='/var/lib/dhcpd/dhcpd.leases'
[ -z "$dhcpdir" ] && [ -f /tmp/dhcp.leases ] && dhcpdir='/tmp/dhcp.leases'
[ -z "$dhcpdir" ] && [ -f /tmp/dnsmasq.leases ] && dhcpdir='/tmp/dnsmasq.leases'
[ -z "$dhcpdir" ] && dhcpdir='/dev/null'
[ -z "$macfilter_type" ] && macfilter_type='黑名单'
if [ "$macfilter_type" = "黑名单" ]; then
fw_filter_lan_over='白名单'
fw_filter_lan_scrip='不'
else
fw_filter_lan_over='黑名单'
fw_filter_lan_scrip=''
fi
comp_box "\033[30;47m请在此添加或移除设备\033[0m" \
"" \
"当前过滤方式为:\033[33m$macfilter_type模式\033[0m" \
"仅列表内设备流量\033[36m$fw_filter_lan_scrip经过\033[0m内核"
if [ -n "$(cat "$CRASHDIR"/configs/mac)" ]; then
content_line "当前已过滤设备为:"
content_line ""
content_line " \033[36m设备mac/ip地址\033[0m \033[35m设备名称\033[0m"
for dev in $(cat "$CRASHDIR"/configs/mac 2>/dev/null); do
get_devinfo
content_line "$(printf "\033[36m%-20s \033[35m%s\033[0m" \
"$dev_mac" "$dev_name")"
done
for dev in $(cat "$CRASHDIR"/configs/ip_filter 2>/dev/null); do
get_devinfo
content_line "$(printf "\033[36m%-20s \033[35m%s\033[0m" \
"$dev_ip" "$dev_name")"
done
separator_line "="
fi
btm_box "1) 切换为\033[33m$fw_filter_lan_over模式\033[0m" \
"2) \033[32m添加指定设备mac地址\033[0m" \
"3) \033[32m添加指定设备IP地址网段\033[0m" \
"4) \033[36m移除指定设备\033[0m" \
"9) \033[31m清空整个列表\033[0m" \
"" \
"0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num
case "$num" in
"" | 0)
break
;;
1)
macfilter_type=$fw_filter_lan_over
if setconfig macfilter_type $macfilter_type; then
msg_alert "\033[32m已切换为$macfilter_type模式\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
2)
add_mac
;;
3)
add_ip
;;
4)
del_all
;;
9)
: >"$CRASHDIR"/configs/mac
: >"$CRASHDIR"/configs/ip_filter
msg_alert "\033[31m设备列表已清空\033[0m"
;;
*)
errornum
;;
esac
done
}

View File

@@ -1,550 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_MODULE_OVERRIDE" ] && return
__IS_MODULE_OVERRIDE=1
YAMLSDIR="$CRASHDIR"/yamls
JSONSDIR="$CRASHDIR"/jsons
# 配置文件覆写
override() {
while true; do
[ -z "$rule_link" ] && rule_link=1
[ -z "$server_link" ] && server_link=1
comp_box "\033[30;47m 欢迎使用配置文件覆写功能!\033[0m"
content_line "2) 管理\033[36m自定义规则\033[0m"
echo "$crashcore" | grep -q 'singbox' || {
content_line "3) 管理\033[33m自定义节点\033[0m"
content_line "4) 管理\033[36m自定义策略组\033[0m"
}
content_line "5) \033[32m自定义\033[0m高级功能"
[ "$disoverride" != 1 ] && content_line "9) \033[33m禁用\033[0m配置文件覆写"
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0)
break
;;
2)
setrules
;;
3)
setproxies
;;
4)
setgroups
;;
5)
if echo "$crashcore" | grep -q 'singbox'; then
set_singbox_adv
else
set_clash_adv
fi
sleep 3
;;
9)
comp_box "\033[33m此功能可能会导致严重问题启用后脚本中大部分功能都将禁用\033[0m" \
"如果你不是非常了解$crashcore的运行机制,切勿开启!\033[0m" \
"\033[33m继续后如出现任何问题请务必自行解决一切提问恕不受理\033[0m"
sleep 2
btm_box "1) 我确认遇到问题可以自行解决" \
"0) 返回上级菜单"
read -r -p "$COMMON_INPUT> " res
[ "$res" = '1' ] && {
disoverride=1
if setconfig disoverride $disoverride; then
common_success
else
common_failed
fi
}
;;
*)
errornum
;;
esac
done
}
# 自定义规则
setrules() {
set_rule_type() {
comp_box "\033[33m请选择规则类型\033[0m"
printf '%s\n' "$rule_type" |
awk '{for (i = 1; i <= NF; i++) print i") " $i}' |
while IFS= read -r line; do
content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0) ;;
[0-9]*)
if [ "$num" -gt $(echo $rule_type | awk -F " " '{print NF}') ]; then
errornum
else
rule_type_set=$(echo "$rule_type" | cut -d' ' -f"$num")
comp_box "\033[33m请输入规则语句\n可以是域名、泛域名、IP网段或者其他匹配规则类型的内容\033[0m"
read -r -p "请输入对应规则> " rule_state_set
if [ -n "$rule_state_set" ]; then
set_group_type
else
errornum
fi
fi
;;
*)
errornum
;;
esac
}
set_group_type() {
comp_box "\033[36m请选择具体规则\033[0m" \
"\033[33m此处规则读取自现有配置文件如果你后续更换配置文件时运行出错请尝试重新添加\033[0m"
printf '%s\n' "$rule_group" |
awk -F '#' '{for (i = 1; i <= NF; i++) print i") " $i}' |
while IFS= read -r line; do
content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0) ;;
[0-9]*)
if [ "$num" -gt "$(echo "$rule_group" | awk -F "#" '{print NF}')" ]; then
errornum
else
rule_group_set=$(echo "$rule_group" | cut -d'#' -f"$num")
rule_all="- ${rule_type_set},${rule_state_set},${rule_group_set}"
echo "IP-CIDR SRC-IP-CIDR IP-CIDR6" | grep -q -- "$rule_type_set" && rule_all="${rule_all},no-resolve"
echo "$rule_all" >>"$YAMLSDIR"/rules.yaml
msg_alert "\033[32m添加成功\033[0m"
fi
;;
*)
errornum
;;
esac
}
del_rule_type() {
while true; do
comp_box "输入对应数字即可移除相应规则:"
sed -i '/^ *$/d; /^#/d' "$YAMLSDIR"/rules.yaml
awk -F '#' '!/^#/ {print NR") "$1 $2 $3}' "$YAMLSDIR/rules.yaml" |
while IFS= read -r line; do
content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0)
break
;;
*)
if [ "$num" -le "$(wc -l <"$YAMLSDIR"/rules.yaml)" ]; then
if sed -i "${num}d" "$YAMLSDIR"/rules.yaml; then
common_success
else
common_failed
fi
sleep 1
else
errornum
fi
;;
esac
done
}
get_rule_group() {
. "$CRASHDIR"/libs/web_save.sh
get_save http://127.0.0.1:${db_port}/proxies | sed 's/:{/!/g' | awk -F '!' '{for(i=1;i<=NF;i++) print $i}' | grep -aE '"Selector|URLTest|LoadBalance"' | grep -aoE '"name":.*"now":".*",' | awk -F '"' '{print "#"$4}' | tr -d '\n'
}
while true; do
comp_box "\033[33m你可以在这里快捷管理自定义规则\033[0m" \
"如需批量操作,请手动编辑:\033[36m $YAMLSDIR/rules.yaml\033[0m" \
"\033[33msingbox和clash共用此处规则可无缝切换\033[0m" \
"大量规则请尽量使用rule-set功能添加\n\033[31m此处过量添加可能导致启动卡顿\033[0m"
content_line "1) 新增自定义规则"
content_line "2) 移除自定义规则"
content_line "3) 清空规则列表"
echo "$crashcore" | grep -q 'singbox' || content_line "4) 配置节点绕过: \033[36m$proxies_bypass\033[0m"
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0)
break
;;
1)
rule_type="DOMAIN-SUFFIX DOMAIN-KEYWORD IP-CIDR SRC-IP-CIDR DST-PORT SRC-PORT GEOIP GEOSITE IP-CIDR6 DOMAIN PROCESS-NAME"
rule_group="DIRECT#REJECT$(get_rule_group)"
set_rule_type
;;
2)
if [ -s "$YAMLSDIR"/rules.yaml ]; then
del_rule_type
else
msg_alert "请先添加自定义规则!"
fi
;;
3)
comp_box "是否确认清空全部自定义规则?"
btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if sed -i '/^\s*[^#]/d' "$YAMLSDIR"/rules.yaml; then
common_success
else
common_failed
fi
fi
;;
4)
if [ "$proxies_bypass" = "OFF" ]; then
comp_box "\033[33m本功能会自动将当前配置文件中的节点域名或IP设置为直连规则以防止出现双重流量\033[0m" \
"\033[33m请确保下游设备使用的节点与ShellCrash中使用的节点相同否则无法生效\033[0m" \
"" \
"是否启用节点绕过?"
btm_box
"1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
proxies_bypass=ON
else
continue
fi
else
proxies_bypass=OFF
fi
if setconfig proxies_bypass "$proxies_bypass"; then
common_success
else
common_failed
fi
;;
*)
errornum
;;
esac
done
}
# 自定义clash策略组
setgroups() {
set_group_type() {
comp_box "\033[33m注意策略组名称必须和【自定义规则】或【自定义节点】功能中指定的策略组一致\033[0m" \
"\033[33m建议先创建策略组之后可在【自定义规则】或【自定义节点】功能中智能指定\033[0m" \
"\033[33m如需在当前策略组下添加节点请手动编辑$YAMLSDIR/proxy-groups.yaml\033[0m"
btm_box "\033[36m请直接输入自定义策略组名称\033[0m\n不支持纯数字且不要包含特殊字符" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " new_group_name
comp_box "\033[32m请选择策略组【$new_group_name】的类型:\033[0m"
printf '%s\n' "$group_type_cn" |
awk '{for (i = 1; i <= NF; i++) print i") " $i}' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入对应数字> " num
new_group_type=$(echo "$group_type" | awk '{print $'"$num"'}')
if [ "$num" = "1" ]; then
unset new_group_url interval
else
comp_box "请输入测速地址" \
"或直接回车使用默认地址https://www.gstatic.com/generate_204"
read -r -p "请输入> " new_group_url
[ -z "$new_group_url" ] && new_group_url=https://www.gstatic.com/generate_204
new_group_url="url: '$new_group_url'"
interval="interval: 300"
fi
set_group_add
# 添加自定义策略组
cat >>"$YAMLSDIR"/proxy-groups.yaml <<EOF
- name: $new_group_name
type: $new_group_type
$new_group_url
$interval
proxies:
- DIRECT
EOF
sed -i "/^ *$/d" "$YAMLSDIR"/proxy-groups.yaml
msg_alert "\033[32m添加成功\033[0m"
}
set_group_add() {
comp_box "\033[36m请选择想要将本策略添加到的策略组\033[0m" \
"\033[32m如需添加到多个策略组请一次性输入多个数字并用空格隔开\033[0m"
printf '%s\n' "$proxy_group" |
awk -F '#' '{for (i = 1; i <= NF; i++) print i") " $i}' |
while IFS= read -r line; do
content_line "$line"
done
content_line ""
content_line "0) 跳过添加"
separator_line "="
read -r -p "请输入对应数字(多个用空格分隔)> " char
case "$char" in
"" | 0) ;;
*)
for num in $char; do
rule_group_set=$(echo "$proxy_group" | cut -d'#' -f"$num")
rule_group_add="${rule_group_add}#${rule_group_set}"
done
if [ -n "$rule_group_add" ]; then
new_group_name="$new_group_name$rule_group_add"
unset rule_group_add
else
errornum
fi
;;
esac
}
while true; do
comp_box "\033[33m你可以在这里快捷管理自定义策略组\033[0m" \
"\033[36m如需修改或批量操作请手动编辑$YAMLSDIR/proxy-groups.yaml\033[0m"
btm_box "1) 添加自定义策略组" \
"2) 查看自定义策略组" \
"3) 清空自定义策略组" \
"" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0)
break
;;
1)
group_type="select url-test fallback load-balance"
group_type_cn="手动选择 自动选择 故障转移 负载均衡"
proxy_group="$(cat "$YAMLSDIR"/proxy-groups.yaml "$YAMLSDIR"/config.yaml 2>/dev/null | sed "/#自定义策略组开始/,/#自定义策略组结束/d" | grep -Ev '^#' | grep -o '\- name:.*' | sed 's/#.*//' | sed 's/- name: /#/g' | tr -d '\n' | sed 's/#//')"
set_group_type
;;
2)
line_break
echo "==========================================================="
cat "$YAMLSDIR"/proxy-groups.yaml
echo ""
echo "==========================================================="
;;
3)
comp_box "是否确认清空全部自定义策略组?"
btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if echo '#用于添加自定义策略组' >"$YAMLSDIR"/proxy-groups.yaml; then
common_success
else
common_failed
fi
fi
;;
*)
errornum
;;
esac
done
}
# 自定义clash节点
setproxies() {
set_proxy_type() {
while true; do
comp_box "\033[33m注意\n节点格式必须是单行、不包括括号、“name:”为开头,例如:\033[0m" \
"\033[36m【name: \"test\", server: 192.168.1.1, port: 12345, type: socks5, udp: true】\033[0m" \
"更多写法请参考:\033[32mhttps://juewuy.github.io/\033[0m"
btm_box "\033[36m请直接输入自定义节点\033[0m" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " proxy_state_set
if [ "$proxy_state_set" = 0 ]; then
break
elif echo "$proxy_state_set" | grep -q "#"; then
msg_alert "\033[33m绝对禁止包含【#】号!\033[0m"
elif echo "$proxy_state_set" | grep -Eq "^name:"; then
set_group_add
else
errornum
fi
done
}
set_group_add() {
comp_box "\033[36m请选择想要将节点添加到的策略组\033[0m" \
"\033[32m如需添加到多个策略组请一次性输入多个数字并用空格隔开\033[0m" \
"\033[33m如需自定义策略组请先使用【管理自定义策略组功能】添加\033[0m"
printf '%s\n' "$proxy_group" |
awk -F '#' '{for (i = 1; i <= NF; i++) print i") " $i}' |
while IFS= read -r line; do
content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字(多个用空格分隔)> " char
case "$char" in
"" | 0) ;;
*)
for num in $char; do
rule_group_set=$(echo "$proxy_group" | cut -d'#' -f"$num")
rule_group_add="${rule_group_add}#${rule_group_set}"
done
if [ -n "$rule_group_add" ]; then
echo "- {$proxy_state_set}$rule_group_add" >>"$YAMLSDIR"/proxies.yaml
msg_alert "\033[32m添加成功\033[0m"
unset rule_group_add
else
errornum
fi
;;
esac
}
while true; do
comp_box "\033[33m你可以在这里快捷管理自定义节点\033[0m" \
"\033[36m如需批量操作请手动编辑$YAMLSDIR/proxies.yaml\033[0m"
btm_box "1) 添加自定义节点" \
"2) 管理自定义节点" \
"3) 清空自定义节点" \
"4) 配置节点绕过: \033[36m$proxies_bypass\033[0m" \
"" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0)
break
;;
1)
proxy_type="DOMAIN-SUFFIX DOMAIN-KEYWORD IP-CIDR SRC-IP-CIDR DST-PORT SRC-PORT GEOIP GEOSITE IP-CIDR6 DOMAIN MATCH"
proxy_group="$(cat "$YAMLSDIR"/proxy-groups.yaml "$YAMLSDIR"/config.yaml 2>/dev/null | sed "/#自定义策略组开始/,/#自定义策略组结束/d" | grep -Ev '^#' | grep -o '\- name:.*' | sed 's/#.*//' | sed 's/- name: /#/g' | tr -d '\n' | sed 's/#//')"
set_proxy_type
;;
2)
sed -i '/^ *$/d' "$YAMLSDIR"/proxies.yaml 2>/dev/null
if [ -s "$YAMLSDIR"/proxies.yaml ]; then
comp_box "\033[33m输入节点对应数字可以移除对应节点\033[0m" \
"当前已添加的自定义节点为:"
grep -Ev '^#' "$YAMLSDIR/proxies.yaml" |
awk -F '[,}]' '{print NR") " $1 " " $NF}' |
sed 's/- {//g' |
while IFS= read -r line; do
content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
if [ "$num" = 0 ]; then
continue
elif [ "$num" -le $(cat "$YAMLSDIR"/proxies.yaml | grep -Ev '^#' | wc -l) ]; then
if sed -i "$num{/^\s*[^#]/d}" "$YAMLSDIR"/proxies.yaml; then
common_success
else
common_failed
fi
else
errornum
fi
else
msg_alert "请先添加自定义节点!"
fi
;;
3)
comp_box "是否确认清空全部自定义节点?"
btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if sed -i '/^\s*[^#]/d' "$YAMLSDIR"/proxies.yaml 2>/dev/null; then
common_success
else
common_failed
fi
else
continue
fi
;;
4)
if [ "$proxies_bypass" = "OFF" ]; then
comp_box "\033[33m本功能会自动将当前配置文件中的节点域名或IP设置为直连规则以防止出现双重流量\033[0m" \
"\033[33m请确保下游设备使用的节点与ShellCrash中使用的节点相同否则无法生效\033[0m" \
"" \
"是否确定启用节点绕过:"
btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
proxies_bypass=ON
else
continue
fi
else
proxies_bypass=OFF
fi
setconfig proxies_bypass "$proxies_bypass"
sleep 1
setrules
break
;;
*)
errornum
;;
esac
done
}
# 自定义clash高级规则
set_clash_adv() {
[ ! -f "$YAMLSDIR"/user.yaml ] && cat >"$YAMLSDIR"/user.yaml <<EOF
#用于编写自定义设定(可参考https://lancellc.gitbook.io/clash/clash-config-file/general 或 https://docs.metacubex.one/function/general)
#端口之类请在脚本中修改,否则不会加载
#port: 7890
EOF
[ ! -f "$YAMLSDIR"/others.yaml ] && cat >"$YAMLSDIR"/others.yaml <<EOF
#用于编写自定义的锚点、入站、proxy-providers、sub-rules、rule-set、script等功能
#可参考 https://github.com/MetaCubeX/Clash.Meta/blob/Meta/docs/config.yaml 或 https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file
#此处内容会被添加在配置文件的“proxy-group”模块的末尾与“rules”模块之前的位置
#例如:
#proxy-providers:
#rule-providers:
#sub-rules:
#tunnels:
#script:
#listeners:
EOF
comp_box "\033[32m已经创建自定义设定文件$YAMLSDIR/user.yaml \033[0m" \
"\033[33m可用于编写自定义的DNS等功能\033[0m" \
"" \
"\033[32m已经创建自定义功能文件$YAMLSDIR/others.yaml \033[0m" \
"\033[33m可用于编写自定义的锚点、入站、proxy-providers、rule-set、sub-rules、script等功能\033[0m"
btm_box "Windows下请使用\033[33mWinSCP软件\033[0m进行编辑\033[0m" \
"MacOS下请使用\033[33mSecureFX软件\033[0m进行编辑\033[0m" \
"Linux可使用\033[33mvim\033[0m进行编辑路由设备若不显示中文请勿使用\033[0m"
}
# s自定义singbox配置文件
set_singbox_adv() {
comp_box "支持覆盖脚本设置的模块有:\033[0m" \
"\033[36mlog dns ntp certificate experimental\033[0m" \
"支持与内置功能合并(但不可冲突)的模块有:\033[0m" \
"\033[36mendpoints inbounds outbounds providers route services\033[0m" \
"将相应json文件放入\033[33m$JSONSDIR\033[0m目录后即可在启动时自动加载" \
"" \
"使用前请务必参考配置教程:\033[32;4m https://juewuy.github.io/nWTjEpkSK \033[0m"
}

View File

@@ -1,103 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_MODULE_PROVIDERS" ] && return
__IS_MODULE_PROVIDERS=1
if [ "$crashcore" = singboxr ]; then
CORE_TYPE=singbox
else
CORE_TYPE=clash
fi
providers() {
while true; do
# 获取模版名称
if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ]; then
provider_temp_des=$(sed -n "1 p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $1}')
else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
provider_temp_des=$(grep "$provider_temp_file" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $1}')
[ -z "$provider_temp_des" ] && provider_temp_des=$provider_temp_file
fi
comp_box "1) \033[32m生成\033[0m包含全部提供者的配置文件" \
"2) 选择\033[33m规则模版\033[0m \033[32m$provider_temp_des\033[0m" \
"3) \033[33m清理\033[0mproviders目录文件" \
"" \
"0) $COMMON_BACK"
read -r -p "请输入对应字母或数字> " num
case "$num" in
"" | 0)
break
;;
1)
if [ -s "$CRASHDIR"/configs/providers.cfg ] || [ -s "$CRASHDIR"/configs/providers_uri.cfg ]; then
. "$CRASHDIR/menus/providers_$CORE_TYPE.sh"
gen_providers
else
msg_alert "\033[31m你还未添加链接或本地配置文件请先添加\033[0m"
fi
;;
2)
list=$(cat "$CRASHDIR/configs/${CORE_TYPE}_providers.list" | awk '{print $1}')
comp_box "当前规则模版为:\033[32m$provider_temp_des\033[0m" \
"\033[33m请选择在线模版\033[0m"
list_box "$list"
btm_box "" \
"a) 使用\033[36m本地模版\033[0m" \
"" \
"0) $COMMON_BACK"
read -r -p "请输入对应字母或数字> " num
case "$num" in
"" | 0) ;;
a)
line_break
read -r -p "请输入模版的路径(绝对路径)> " dir
if [ -s "$dir" ]; then
provider_temp_file=$dir
if setconfig provider_temp_"$CORE_TYPE" "$provider_temp_file"; then
common_success
else
common_failed
fi
else
msg_alert "\033[31m输入错误找不到对应模版文件\033[0m"
fi
;;
*)
provider_temp_file=$(sed -n "$num p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list 2>/dev/null | awk '{print $2}')
if [ -z "$provider_temp_file" ]; then
errornum
else
if setconfig provider_temp_"$CORE_TYPE" "$provider_temp_file"; then
common_success
else
common_failed
fi
fi
;;
esac
;;
3)
comp_box "\033[33m将清空 $CRASHDIR/providers 目录下所有内容\033[0m" \
"" \
"是否继续?"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if rm -rf "$CRASHDIR"/providers; then
common_success
else
common_failed
fi
fi
;;
*)
errornum
;;
esac
done
}

View File

@@ -1,125 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_PROVIDERS_CLASH" ] && return
__IS_PROVIDERS_CLASH=1
. "$CRASHDIR"/libs/web_get_bin.sh
# 生成clash的providers配置文件
gen_providers() {
if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ]; then
provider_temp_file="$(sed -n "1 p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $2}')"
else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi
if [ -s "$provider_temp_file" ]; then
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
else
msg_alert "\033[33m正在获取在线模版......\033[0m"
get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_providers/$provider_temp_file"
[ -z "$(grep -o 'rules' "$TMPDIR"/provider_temp_file)" ] && {
msg_alert "\033[31m下载失败请尝试更换安装源\033[0m"
. "$CRASHDIR"/menus/9_upgrade.sh && setserver
setproviders
}
fi
# 生成proxy_providers模块
mkdir -p "$TMPDIR"/providers
# 预创建文件并写入对应文件头
echo 'proxy-providers:' >"$TMPDIR"/providers/providers.yaml
# 切割模版文件
sed -n '/^proxy-groups:/,/^[a-z]/ { /^rule/d; p; }' "$TMPDIR"/provider_temp_file >"$TMPDIR"/providers/proxy-groups.yaml
sed -n '/^rule/,$p' "$TMPDIR"/provider_temp_file >"$TMPDIR"/providers/rules.yaml
rm -rf "$TMPDIR"/provider_temp_file
# 基于单订阅生成providers模块
if [ -n "$1" ]; then
gen_providers_txt "$@"
providers_tags=$1
else
# 基于全部订阅/本地文件生成
[ -s "$CRASHDIR"/configs/providers.cfg ] && {
providers_tags=''
while read -r line; do
gen_providers_txt $line
providers_tags=$(echo "$providers_tags, $tag" | sed 's/^, //')
done <"$CRASHDIR"/configs/providers.cfg
}
# 基于全部节点分享链接生成
[ -s "$CRASHDIR"/configs/providers_uri.cfg ] && {
mkdir -p "$CRASHDIR"/providers
awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' "$CRASHDIR"/configs/providers_uri.cfg >"$CRASHDIR"/providers/uri_group
gen_providers_txt "Uri_group" "./providers/uri_group" "3" "12"
providers_tags=$(echo "$providers_tags, Uri_group" | sed 's/^, //')
}
fi
# 修饰模版文件并合并
sed -i "s/{providers_tags}/$providers_tags/g" "$TMPDIR"/providers/proxy-groups.yaml
cut -c 1- "$TMPDIR"/providers/providers.yaml "$TMPDIR"/providers/proxy-groups.yaml "$TMPDIR"/providers/rules.yaml >"$TMPDIR"/config.yaml
rm -rf "$TMPDIR"/providers
# 调用内核测试
. "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore -t -d "$BINDIR" -f "$TMPDIR"/config.yaml
if [ "$?" = 0 ]; then
msg_alert "\033[32m配置文件生成成功\033[0m"
mkdir -p "$CRASHDIR"/yamls
mv -f "$TMPDIR"/config.yaml "$CRASHDIR"/yamls/config.yaml
comp_box "是否立即启动/重启服务?"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && {
start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅'
exit
}
else
rm -rf "$TMPDIR"/CrashCore
rm -rf "$TMPDIR"/config.yaml
msg_alert "\033[31m生成配置文件出错请仔细检查输入\033[0m"
fi
}
gen_providers_txt() {
if [ -n "$(echo "$2" | grep -E '^./')" ]; then
type=file
path=$2
download_url=
else
type=http
path="./providers/$1.yaml"
download_url=$2
fi
tag=$1
interval=${3:-3}
interval2=${4:-12}
ua=${5:-clash.meta}
exclude=${6#\#}
include=${7#\#}
cat >>"$TMPDIR"/providers/providers.yaml <<EOF
${1}:
type: $type
url: "$download_url"
path: "$path"
interval: $((interval2 * 3600))
health-check:
enable: true
lazy: true
url: "https://www.gstatic.com/generate_204"
interval: $((interval * 60))
EOF
[ "$crashcore" = 'meta' ] && {
[ "$skip_cert" != "OFF" ] && skip_cert_verify='skip-cert-verify: true'
cat >>"$TMPDIR"/providers/providers.yaml <<EOF
header:
User-Agent: ["$ua"]
override:
udp: true
$skip_cert_verify
filter: "$include"
exclude-filter: "$exclude"
EOF
}
# 写入提供者
echo ' - {name: '"$tag"', type: url-test, tolerance: 100, lazy: true, use: ['"$tag"']}' >>"$TMPDIR"/providers/proxy-groups.yaml
}

View File

@@ -1,133 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_PROVIDERS_SINGBOX" ] && return
__IS_PROVIDERS_SINGBOX=1
. "$CRASHDIR"/libs/web_get_bin.sh
# 生成singbox的providers配置文件
gen_providers() {
if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ]; then
provider_temp_file="$(sed -n "1 p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $2}')"
else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi
if [ -s "$provider_temp_file" ]; then
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
else
msg_alert "\033[33m正在获取在线模版......\033[0m"
get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_providers/$provider_temp_file"
[ -z "$(grep -o 'route' "$TMPDIR"/provider_temp_file)" ] && {
msg_alert "\033[31m下载失败请尝试更换安装源\033[0m"
. "$CRASHDIR"/menus/9_upgrade.sh && setserver
setproviders
}
fi
# 生成outbound_providers模块
mkdir -p "$TMPDIR"/providers
# 预创建文件并写入对应文件头
cat >"$TMPDIR"/providers/providers.json <<EOF
{
"providers": [
EOF
cat >"$TMPDIR"/providers/outbounds_add.json <<EOF
{
"outbounds": [
EOF
# 基于单订阅生成providers模块
if [ -n "$1" ]; then
gen_providers_txt "$@"
providers_tags=\"$1\"
else
# 基于全部订阅/本地文件生成
[ -s "$CRASHDIR"/configs/providers.cfg ] && {
providers_tags=''
while read -r line; do
gen_providers_txt $line
providers_tags=$(echo "$providers_tags, \"$tag\"" | sed 's/^, //')
done <"$CRASHDIR"/configs/providers.cfg
}
# 基于全部节点分享链接生成
[ -s "$CRASHDIR"/configs/providers_uri.cfg ] && {
mkdir -p "$CRASHDIR"/providers
awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' "$CRASHDIR"/configs/providers_uri.cfg >"$CRASHDIR"/providers/uri_group
gen_providers_txt "Uri_group" "./providers/uri_group" "3" "12"
providers_tags=$(echo "$providers_tags, \"Uri_group\"" | sed 's/^, //')
}
fi
# 修复文件格式
sed -i '$s/},/}]}/' "$TMPDIR"/providers/outbounds_add.json
sed -i '$s/},/}]}/' "$TMPDIR"/providers/providers.json
# 使用模版生成outbounds和rules模块
cat "$TMPDIR"/provider_temp_file | sed "s/{providers_tags}/$providers_tags/g" | sed "s/\"providers_tags\"/$providers_tags/g" >"$TMPDIR"/providers/outbounds.json
rm -rf "$TMPDIR"/provider_temp_file
# 调用内核测试
. "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore merge "$TMPDIR"/config.json -C "$TMPDIR"/providers
if [ "$?" = 0 ]; then
msg_alert "\033[32m配置文件生成成功如果启动超时建议更新里手动安装Singbox-srs数据库常用包\033[0m"
mkdir -p "$CRASHDIR"/jsons
mv -f "$TMPDIR"/config.json "$CRASHDIR"/jsons/config.json
rm -rf "$TMPDIR"/providerss
comp_box "是否立即启动/重启服务?"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && {
start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅'
exit
}
else
rm -rf "$TMPDIR"/CrashCore
msg_alert "\033[31m生成配置文件出错请仔细检查输入\033[0m"
# rm -rf "$TMPDIR"/providers
fi
}
gen_providers_txt() {
tag=$1
interval=${3:-3}
interval2=${4:-12}
ua=${5:-clash.meta}
exclude=${6#\#}
include=${7#\#}
[ -n "$exclude" ] && exclude_ele="\"exclude\": \"$exclude\","
[ -n "$include" ] && include_ele="\"include\": \"$include\","
if [ -n "$(echo "$2" | grep -E '^./')" ]; then
cat >>"$TMPDIR"/providers/providers.json <<EOF
{
"tag": "$tag",
"type": "local",
"path": "$2",
EOF
else
cat >>"$TMPDIR"/providers/providers.json <<EOF
{
"tag": "$tag",
"type": "remote",
"url": "$2",
"path": "./providers/$tag.yaml",
"user_agent": "$ua",
"update_interval": "${interval2}h",
$exclude_ele
$include_ele
EOF
fi
# 通用部分生成
[ "$skip_cert" != "OFF" ] && override_tls='true' || override_tls='false'
cat >>"$TMPDIR"/providers/providers.json <<EOF
"health_check": {
"enabled": true,
"url": "https://www.gstatic.com/generate_204",
"interval": "${interval}m",
"timeout": "3s"
},
"override_tls": {
"enabled": true,
"insecure": $override_tls
}
},
EOF
# 写入提供者
echo '{ "tag": "'"$tag"'", "type": "urltest", "tolerance": 100, "providers": ["'"$tag"'"], "include": ".*" },' >>"$TMPDIR"/providers/outbounds_add.json
}

View File

@@ -1,13 +1,13 @@
running_status(){ running_status(){
VmRSS=$(awk '/^VmRSS:/ {printf "%.2f MB\n", ($2 * 1024) / 1000000}' /proc/$PID/status) VmRSS=$(cat /proc/$PID/status | grep -w VmRSS | awk 'unit="MB" {printf "%.2f %s\n", $2/1000, unit}')
#获取运行时长 #获取运行时长
touch "$TMPDIR"/crash_start_time #用于延迟启动的校验 touch "$TMPDIR"/crash_start_time #用于延迟启动的校验
start_time=$(cat "$TMPDIR"/crash_start_time) start_time=$(cat "$TMPDIR"/crash_start_time)
if [ -n "$start_time" ]; then if [ -n "$start_time" ]; then
time=$(($(date +%s) - start_time)) time=$(($(date +%s) - start_time))
day=$((time / 86400)) day=$((time / 86400))
[ "$day" = "0" ] && day='' || day="$dayD" [ "$day" = "0" ] && day='' || day="$day"
time=$(date -u -d @${time} +%H:%M:%S) time=$(date -u -d @${time} +%H小时%M%S)
fi fi
} }

View File

@@ -1,187 +1,150 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
[ -f /tmp/SC_tmp/libs/check_dir_avail.sh ] && . /tmp/SC_tmp/libs/check_dir_avail.sh . /tmp/SC_tmp/libs/check_dir_avail.sh
[ -n "$(echo -e | grep e)" ] && echo=echo || echo='echo -e'
set_usb_dir() {
while true; do
comp_box "请选择安装目录:"
du -hL /mnt |
awk '{print NR") "$2 " " $1}' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入相应数字> " num
dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
if [ -z "$dir" ]; then
msg_alert "\033[31m输入错误请重新设置\033[0m"
continue
fi
break 1
done
}
set_xiaomi_dir() {
comp_box "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m"
[ -d /data ] && content_line "1) /data目录剩余空间$(dir_avail /data -h) (支持软固化功能)"
[ -d /userdisk ] && content_line "2) /userdisk目录剩余空间$(dir_avail /userdisk -h) (支持软固化功能)"
[ -d /data/other_vol ] && content_line "3) /data/other_vol目录剩余空间$(dir_avail /data/other_vol -h) (支持软固化功能)"
content_line "4) 自定义目录(不推荐,不明勿用!)"
content_line ""
content_line "0) 退出安装"
separator_line "="
read -r -p "请输入相应数字> " num
case "$num" in
1)
dir=/data
;;
2)
dir=/userdisk
;;
3)
dir=/data/other_vol
;;
4)
set_cust_dir
;;
*)
line_break
exit 1
;;
esac
}
set_asus_usb() {
while true; do
comp_box "请选择U盘目录"
du -hL /tmp/mnt |
awk -F/ 'NF<=4 {print NR") "$2 " " $1}' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入相应数字> " num
dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p)
if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then
msg_alert "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m"
else
break
fi
done
}
set_asus_dir() {
separator_line "="
btm_box "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m" \
"1) 基于U盘+下载大师安装支持所有固件限ARM设备须插入U盘或移动硬盘" \
"2) 基于自启脚本安装(仅持部分梅林固件)" \
"" \
"0) 退出安装"
read -r -p "请输入相应数字> " num
case "$num" in
1)
msg_alert -t 2 "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
set_asus_usb
;;
2)
msg_alert -t 2 "如开机无法正常自启请重新使用U盘+下载大师安装!"
dir=/jffs
;;
*)
line_break
exit 1
;;
esac
}
set_cust_dir() {
while true; do
comp_box "路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!" \
"" \
"可用路径 剩余空间:"
df -h |
awk '{print $6, $4}' |
sed '1d' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入自定义路径> " dir
if [ "$(dir_avail "$dir")" = 0 ] || [ -n "$(echo "$dir" | grep -Eq '^/(tmp|opt|sys)(/|$)')" ]; then
msg_alert "\033[31m路径错误请重新设置\033[0m"
continue
fi
break 1
done
}
set_crashdir() { set_crashdir() {
while true; do set_usb_dir() {
top_box "\033[33m注意安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m" echo -e "请选择安装目录"
case "$systype" in du -hL /mnt | awk '{print " "NR" "$2" "$1}'
Padavan) read -p "请输入相应数字 > " num
dir=/etc/storage dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
;; if [ -z "$dir" ]; then
mi_snapshot) echo -e "\033[31m输入错误请重新设置\033[0m"
set_xiaomi_dir set_usb_dir
;; fi
asusrouter) }
set_asus_dir() {
echo -e "请选择U盘目录"
du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print " "NR" "$2" "$1}'
read -p "请输入相应数字 > " num
dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p)
if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then
echo -e "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m"
set_asus_dir set_asus_dir
;; fi
ng_snapshot) }
dir=/tmp/mnt set_cust_dir() {
;; echo "-----------------------------------------------"
*) echo "可用路径 剩余空间:"
separator_line "=" df -h | awk '{print $6,$4}' | sed 1d
btm_box "1) 在\033[32m/etc目录\033[0m下安装适合root用户" \ echo "路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!"
"2) 在\033[32m/usr/share目录\033[0m下安装适合Linux系统" \ read -p "请输入自定义路径 > " dir
"3) 在\033[32m当前用户目录\033[0m下安装适合非root用户" \ if [ "$(dir_avail $dir)" = 0 ] || [ -n "$(echo $dir | grep -E 'tmp|opt|sys')" ]; then
"4) 在\033[32m外置存储\033[0m中安装" \ echo "\033[31m路径错误请重新设置\033[0m"
"5) 手动设置安装目录" \ set_cust_dir
"" \ fi
"0) 退出安装" }
read -r -p "请输入相应数字> " num echo "-----------------------------------------------"
# 设置目录 if [ -n "$systype" ]; then
[ "$systype" = "Padavan" ] && dir=/etc/storage
[ "$systype" = "mi_snapshot" ] && {
echo -e "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m"
[ -d /data ] && $echo " 1 安装到 /data 目录,剩余空间:$(dir_avail /data -h)(支持软固化功能)"
[ -d /userdisk ] && $echo " 2 安装到 /userdisk 目录,剩余空间:$(dir_avail /userdisk -h)(支持软固化功能)"
[ -d /data/other_vol ] && $echo " 3 安装到 /data/other_vol 目录,剩余空间:$(dir_avail /data/other_vol -h)(支持软固化功能)"
$echo " 4 安装到自定义目录(不推荐,不明勿用!)"
echo " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
case "$num" in case "$num" in
1) 1)
dir=/etc dir=/data
;; ;;
2) 2)
dir=/usr/share dir=/userdisk
;; ;;
3) 3)
dir=~/.local/share dir=/data/other_vol
mkdir -p ~/.config/systemd/user
;; ;;
4) 4)
set_usb_dir
;;
5)
set_cust_dir set_cust_dir
;; ;;
*) *)
msg_alert "安装已取消"
line_break
exit 1 exit 1
;; ;;
esac esac
}
[ "$systype" = "asusrouter" ] && {
echo -e "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m"
echo -e " 1 基于USB设备安装(限23年9月之前固件须插入\033[31m任意\033[0mUSB设备)"
echo -e " 2 基于自启脚本安装(仅支持梅林及部分非koolshare官改固件)"
echo -e " 3 基于U盘+下载大师安装(支持所有固件限ARM设备须插入U盘或移动硬盘)"
echo -e " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
case "$num" in
1)
read -p "将脚本安装到USB存储/系统闪存?(1/0) > " res
[ "$res" = "1" ] && set_usb_dir || dir=/jffs
usb_status=1
;;
2)
echo -e "如无法正常开机启动请重新使用USB方式安装"
sleep 2
dir=/jffs
;;
3)
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
sleep 2
set_asus_dir
;;
*)
exit 1
;;
esac
}
[ "$systype" = "ng_snapshot" ] && dir=/tmp/mnt
else
echo -e "\033[33m安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m"
echo -e " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)"
echo -e " 2 在\033[32m/usr/share目录\033[0m下安装(适合Linux系统)"
echo -e " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)"
echo -e " 4 在\033[32m外置存储\033[0m中安装"
echo -e " 5 手动设置安装目录"
echo -e " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
#设置目录
case "$num" in
1)
dir=/etc
;;
2)
dir=/usr/share
;;
3)
dir=~/.local/share
mkdir -p ~/.config/systemd/user
;;
4)
set_usb_dir
;;
5)
echo "-----------------------------------------------"
echo "可用路径 剩余空间:"
df -h | awk '{print $6,$4}' | sed 1d
echo "路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!"
read -p "请输入自定义路径 > " dir
if [ -z "$dir" ]; then
echo -e "\033[31m路径错误请重新设置\033[0m"
setdir
fi
;;
*)
echo "安装已取消"
exit 1
;; ;;
esac esac
fi
if [ ! -w "$dir" ]; then if [ ! -w $dir ]; then
msg_alert "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" echo -e "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" && sleep 1 && setdir
else else
comp_box "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail "$dir" -h)" \ echo -e "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail $dir -h)"
"" \ read -p "确认安装?(1/0) > " res
"是否确认安装?" [ "$res" = "1" ] && CRASHDIR=$dir/ShellCrash || setdir
btm_box "1) 是" \ fi
"0) 否"
read -r -p "请输入相应数字> " res
if [ "$res" = "1" ]; then
CRASHDIR="$dir"/ShellCrash
break
fi
fi
done
} }

View File

@@ -1,219 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_MODULE_SUBCONVERTER" ] && return
__IS_MODULE_SUBCONVERTER=1
[ -z "$rule_link" ] && rule_link=1
[ -z "$server_link" ] && server_link=1
# Subconverter在线订阅转换
subconverter() {
while true; do
comp_box "1) \033[32m生成\033[0m包含全部节点、订阅的配置文件"\
"2) 设置\033[31m排除节点正则\033[0m \033[47;30m$exclude\033[0m"\
"3) 设置\033[32m包含节点正则\033[0m \033[47;30m$include\033[0m"\
"4) 选择\033[33m在线规则模版\033[0m"\
"5) 选择\033[0mSubconverter服务器\033[0m"\
"6) 自定义浏览器UA \033[32m$user_agent\033[0m"\
""\
"0) $COMMON_BACK"
read -r -p "请输入对应数字> " num
case "$num" in
"" | 0)
break
;;
1)
providers_link=$(grep -v '\./providers/' "$CRASHDIR"/configs/providers.cfg 2>/dev/null | awk '{print $2}' | tr '\n' '|')
uri_link=$(grep -v '^#' "$CRASHDIR"/configs/providers_uri.cfg 2>/dev/null | awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' | tr '\n' '|')
Url=$(echo "$providers_link|$uri_link" | sed 's/||*/|/g; s/^|//; s/|$//')
setconfig Url "'$Url'"
Https=''
setconfig Https
# 获取在线文件
jump_core_config
;;
2)
gen_link_flt
;;
3)
gen_link_ele
;;
4)
gen_link_config
;;
5)
gen_link_server
;;
6)
set_sub_ua
;;
*)
errornum
;;
esac
done
}
# 排除节点正则
gen_link_flt() {
comp_box "\033[33m匹配关键字的节点会在导入时被【屏蔽】\033[0m" \
"多个关键字可以用\033[30;47m | \033[0m号分隔" \
"\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代"
btm_box "\033[36m请直接输入节点过滤关键字\033[0m" \
"或输入 d \033[31m清空\033[0m节点过滤关键字" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " res
case "$res" in
0)
return 0
;;
d)
exclude=''
;;
*)
exclude="$res"
;;
esac
if setconfig exclude "'$exclude'"; then
common_success
else
common_failed
fi
}
# 包含节点正则
gen_link_ele() {
comp_box "\033[33m仅有匹配关键字的节点才会被【导入】\033[0m" \
"多个关键字可以用\033[30;47m | \033[0m号分隔" \
"\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代"
btm_box "\033[36m请直接输入节点匹配关键字\033[0m" \
"或输入 d \033[31m清空\033[0m节点匹配关键字" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " res
case "$res" in
0)
return 0
;;
d)
include=""
;;
*)
include="$res"
;;
esac
if setconfig include "'$include'"; then
common_success
else
common_failed
fi
}
# 选择在线规则模版
gen_link_config() {
list=$(grep -aE '^5' "$CRASHDIR"/configs/servers.list | awk '{print $2$4}')
now=$(grep -aE '^5' "$CRASHDIR"/configs/servers.list | sed -n ""$rule_link"p" | awk '{print $2}')
comp_box "当前使用规则为:\033[33m$now\033[0m"
list_box "$list"
content_line ""
common_back
read -r -p "请输入对应数字> " num
totalnum=$(grep -acE '^5' "$CRASHDIR"/configs/servers.list)
if [ -z "$num" ] || [ "$num" -gt "$totalnum" ]; then
errornum
elif [ "$num" = 0 ]; then
echo
elif [ "$num" -le "$totalnum" ]; then
# 将对应标记值写入配置
rule_link=$num
if setconfig rule_link "$rule_link"; then
msg_alert "\033[32m设置成功返回上级菜单\033[0m"
else
common_failed
fi
fi
}
# 选择Subconverter服务器
gen_link_server() {
list=$(grep -aE '^3|^4' "$CRASHDIR"/configs/servers.list | awk '{print $3" "$2}')
now=$(grep -aE '^3|^4' "$CRASHDIR"/configs/servers.list | sed -n ""$server_link"p" | awk '{print $3}')
comp_box "\033[36m以下为互联网采集的第三方服务器具体安全性请自行斟酌\033[0m" \
"\033[32m感谢以下作者的无私奉献\033[0m" \
"" \
"当前使用后端为:\033[33m$now\033[0m"
list_box "$list"
content_line ""
common_back
read -r -p "请输入对应数字> " num
totalnum=$(grep -acE '^3|^4' "$CRASHDIR"/configs/servers.list)
if [ -z "$num" ] || [ "$num" -gt "$totalnum" ]; then
errornum
elif [ "$num" = 0 ]; then
echo
elif [ "$num" -le "$totalnum" ]; then
# 将对应标记值写入配置
server_link=$num
if setconfig server_link "$server_link"; then
content_line "\033[32m设置成功返回上级菜单\033[0m"
else
common_failed
fi
fi
}
set_sub_ua() {
while true; do
comp_box "\033[36m无法正确获取配置文件时可尝试使用\033[0m" \
"" \
"当前UA$user_agent"
btm_box "1) 使用自动UA默认"\
"2) 不使用UA"\
"3) 使用自定义UA"\
"4) 清空UA"\
""\
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in
0)
break
;;
1)
user_agent='auto'
;;
2)
user_agent='none'
;;
3)
comp_box "\033[33m注意\n自定义UA不可包含空格或特殊符号\033[0m"
btm_box "\033[36m请直接输入自定义UA\033[0m" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
if [ "$text" = 0 ]; then
continue
elif [ -n "$text" ]; then
user_agent="$text"
fi
;;
4)
user_agent=''
;;
*)
errornum
continue
;;
esac
if [ "$num" -ge 1 ] && [ "$num" -le 4 ]; then
if setconfig user_agent "$user_agent"; then
common_success
else
common_failed
fi
fi
break
done
}

View File

@@ -1,148 +0,0 @@
# tui/layout.sh
# Terminal UI layout helpers
# Provides menu/table formatting utilities
# set the total width of the menu
# (adjusting this number will automatically change the entire menu, including the separator lines)
# note: The number represents the number of columns that appear when the "||" appears on the right
TABLE_WIDTH=60
# define two extra-long template strings in advance
# (the length should be greater than the expected TABLE_WIDTH)
FULL_EQ="===================================================================================================="
FULL_DASH="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
# function to print content lines
content_line() {
raw_input="$1"
if [ -z "$raw_input" ]; then
printf " \033[%dG||\n" "$TABLE_WIDTH"
return
fi
printf '%b' "$raw_input" | LC_ALL=C awk -v table_width="$TABLE_WIDTH" '
BEGIN {
textWidth = table_width - 3
currentDisplayWidth = 0
wordWidth = 0
currentLine = ""
wordBuffer = ""
lastColor = ""
savedColor = ""
ESC = sprintf("%c", 27)
}
{
n = split($0, chars, "")
for (i = 1; i <= n; i++) {
r = chars[i]
if (r == ESC && i+1 <= n && chars[i+1] == "[") {
ansiSeq = ""
for (j = i; j <= n; j++) {
ansiSeq = ansiSeq chars[j]
if (chars[j] == "m") {
i = j
break
}
}
wordBuffer = wordBuffer ansiSeq
lastColor = ansiSeq
continue
}
charWidth = 1
if (r <= "\177") { charWidth = 1 }
else if (r >= "\340" && r <= "\357" && i+2 <= n) {
r = chars[i] chars[i+1] chars[i+2]
i += 2
charWidth = 2
}
else if (r >= "\300" && r <= "\337" && i+1 <= n) {
r = chars[i] chars[i+1]
i += 1
charWidth = 1
}
if (r == " " || charWidth == 2) {
if (currentDisplayWidth + wordWidth + charWidth > textWidth) {
printf " %s\033[0m\033[%dG||\n", currentLine, table_width
currentLine = savedColor wordBuffer
currentDisplayWidth = wordWidth
wordBuffer = r
wordWidth = charWidth
savedColor = lastColor
} else {
currentLine = currentLine wordBuffer r
currentDisplayWidth += wordWidth + charWidth
wordBuffer = ""
wordWidth = 0
savedColor = lastColor
}
} else {
wordBuffer = wordBuffer r
wordWidth += charWidth
if (wordWidth > textWidth) {
printf " %s%s\033[0m\033[%dG||\n", currentLine, wordBuffer, table_width
currentLine = savedColor
currentDisplayWidth = 0
wordBuffer = ""
wordWidth = 0
savedColor = lastColor
}
}
}
if (wordWidth > 0) {
if (currentDisplayWidth + wordWidth > textWidth) {
printf " %s\033[0m\033[%dG||\n", currentLine, table_width
currentLine = savedColor wordBuffer
} else {
currentLine = currentLine wordBuffer
}
}
printf " %s\033[0m\033[%dG||\n", currentLine, table_width
currentLine = lastColor
currentDisplayWidth = 0
wordBuffer = ""
wordWidth = 0
savedColor = lastColor
}
END {}
'
}
# function to print sub content lines
# for printing accompanying instructions
sub_content_line() {
param="$1"
if [ -z "$param" ]; then
printf " \033[%dG||\n" "$TABLE_WIDTH"
return
fi
content_line " $param"
printf " \033[%dG||\n" "$TABLE_WIDTH"
}
# function to print separators
# (using string slicing)
# parameter $1: pass in "=" or "-"
separator_line() {
separatorType="$1"
lenLimit=$((TABLE_WIDTH - 1))
outputLine=""
if [ "$separatorType" = "=" ]; then
outputLine=$(printf "%.${lenLimit}s" "$FULL_EQ")
else
outputLine=$(printf "%.${lenLimit}s" "$FULL_DASH")
fi
printf "%s||\n" "$outputLine"
}
# increase the spacing between the front
# and back forms to improve readability
line_break() {
printf "\n\n"
}

View File

@@ -1,18 +0,0 @@
TABLE_WIDTH=60
content_line() {
printf '%b' " $1\n"
}
sub_content_line() {
content_line " $1"
}
separator_line() {
echo "-----------------------------------------------"
}
line_break() {
return
}

View File

@@ -1,27 +1,19 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
# 卸载 #卸载
uninstall() { uninstall() {
comp_box "\033[31m警告该操作不可逆\033[0m" \ read -p "确认卸载ShellCrash(警告:该操作不可逆!)[1/0] > " res
"是否确认卸载ShellCrash"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
# 停止服务 #停止服务
"$CRASHDIR"/start.sh stop 2>/dev/null "$CRASHDIR"/start.sh stop 2>/dev/null
"$CRASHDIR"/start.sh cronset "clash服务" 2>/dev/null "$CRASHDIR"/start.sh cronset "clash服务" 2>/dev/null
"$CRASHDIR"/start.sh cronset "订阅链接" 2>/dev/null "$CRASHDIR"/start.sh cronset "订阅链接" 2>/dev/null
"$CRASHDIR"/start.sh cronset "ShellCrash初始化" 2>/dev/null "$CRASHDIR"/start.sh cronset "ShellCrash初始化" 2>/dev/null
"$CRASHDIR"/start.sh cronset "task.sh" 2>/dev/null "$CRASHDIR"/start.sh cronset "task.sh" 2>/dev/null
#移除安装目录
# 移除安装目录
if [ -n "$CRASHDIR" ] && [ "$CRASHDIR" != '/' ]; then if [ -n "$CRASHDIR" ] && [ "$CRASHDIR" != '/' ]; then
comp_box "是否保留脚本配置及订阅文件?" read -p "是否保留脚本配置及订阅文件?[1/0] > " res
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
mv -f "$CRASHDIR"/configs /tmp/ShellCrash/configs_bak mv -f "$CRASHDIR"/configs /tmp/ShellCrash/configs_bak
mv -f "$CRASHDIR"/yamls /tmp/ShellCrash/yamls_bak mv -f "$CRASHDIR"/yamls /tmp/ShellCrash/yamls_bak
@@ -34,10 +26,10 @@ uninstall() {
rm -rf "$CRASHDIR" rm -rf "$CRASHDIR"
fi fi
else else
msg_alert "\033[31m环境变量配置有误请尝试手动移除安装目录\033[0m" echo -e "\033[31m环境变量配置有误请尝试手动移除安装目录\033[0m"
sleep 1
fi fi
#移除其他内容
# 移除其他内容
sed -i "/alias $my_alias=*/"d /etc/profile 2>/dev/null sed -i "/alias $my_alias=*/"d /etc/profile 2>/dev/null
sed -i '/alias crash=*/'d /etc/profile 2>/dev/null sed -i '/alias crash=*/'d /etc/profile 2>/dev/null
sed -i '/export CRASHDIR=*/'d /etc/profile 2>/dev/null sed -i '/export CRASHDIR=*/'d /etc/profile 2>/dev/null
@@ -62,12 +54,12 @@ uninstall() {
userdel -r shellcrash 2>/dev/null userdel -r shellcrash 2>/dev/null
nvram set script_usbmount="" 2>/dev/null nvram set script_usbmount="" 2>/dev/null
nvram commit 2>/dev/null nvram commit 2>/dev/null
comp_box "\033[36m已卸载ShellCrash相关文件有缘再会\033[0m" \ echo "-----------------------------------------------"
"\033[33m请手动关闭当前窗口以重置环境变量\033[0m" echo -e "\033[36m已卸载ShellCrash相关文件有缘再会\033[0m"
line_break echo -e "\033[33m请手动关闭当前窗口以重置环境变量\033[0m"
sleep 1 echo "-----------------------------------------------"
exit 0 exit
else else
msg_alert "\033[31m操作已取消\033[0m" echo -e "\033[31m操作已取消\033[0m"
fi fi
} }

View File

@@ -1,126 +0,0 @@
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_MODULE_USERGUIDE_LOADED" ] && return
__IS_MODULE_USERGUIDE_LOADED=1
load_lang userguide
forwhat() {
while true; do
comp_box "\033[30;46m$UG_WELCOME\033[0m" \
"" \
"\033[33m$UG_CHOOSE_ENV\033[0m" \
"\033[0m$UG_TIP_CONFIG\033[0m"
content_line "1) \033[32m$UG_OPTION_1\033[0m"
content_line "2) \033[36m$UG_OPTION_2\033[0m"
[ -s "$CRASHDIR"/configs.tar.gz ] && content_line "3) \033[33m$UG_OPTION_3\033[0m"
separator_line "="
read -r -p "$COMMON_INPUT> " num
case "$num" in
"" | 1)
# 设置运行模式
redir_mod="Mix"
content_line "$cputype" | grep -Eq 'linux.*mips.*' && {
if grep -qE '^TPROXY$' /proc/net/ip_tables_targets || modprobe xt_TPROXY >/dev/null 2>&1; then
redir_mod="Tproxy"
else
redir_mod="Redir"
fi
}
[ -z "$crashcore" ] && crashcore=meta
setconfig crashcore "$crashcore"
setconfig redir_mod "$redir_mod"
setconfig dns_mod mix
setconfig firewall_area '1'
# 默认启用绕过CN-IP
setconfig cn_ip_route ON
# 自动识别IPV6
[ -n "$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g')" ] && {
setconfig ipv6_redir ON
setconfig ipv6_support ON
setconfig ipv6_dns ON
setconfig cn_ipv6_route ON
}
# 设置开机启动
if [ -f /etc/rc.common ] && [ "$(cat /proc/1/comm)" = "procd" ]; then
/etc/init.d/shellcrash enable
fi
ckcmd systemctl && [ "$(cat /proc/1/comm)" = "systemd" ] && systemctl enable shellcrash.service >/dev/null 2>&1
rm -rf "$CRASHDIR"/.dis_startup
autostart=enable
# 检测IP转发
if [ "$(cat /proc/sys/net/ipv4/ip_forward)" = "0" ]; then
separator_line "-"
content_line "\033[33m$UG_IP_FORWARD_WARN\033[0m"
read -r -p "$COMMON_INPUT_R" res
[ "$res" = 1 ] && {
content_line 'net.ipv4.ip_forward = 1' >>/etc/sysctl.conf
sysctl -w net.ipv4.ip_forward=1
}
fi
# 禁止docker启用的net.bridge.bridge-nf-call-iptables
sysctl -w net.bridge.bridge-nf-call-iptables=0 >/dev/null 2>&1
sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1
break
;;
2)
setconfig redir_mod "Redir"
content_line "$cputype" | grep -Eq "linux.*mips.*" && setconfig crashcore "clash"
setconfig common_ports "OFF"
setconfig firewall_area '2'
break
;;
3)
tar -zxf "$CRASHDIR"/configs.tar.gz -C "$CRASHDIR"/configs
msg_alert "\033[32m$UG_RESTORE_OK\033[0m"
line_break
exit 0
;;
*)
errornum
;;
esac
done
}
# 新手引导
userguide() {
. "$CRASHDIR"/libs/check_dir_avail.sh
forwhat
# 检测小内存模式
dir_size=$(dir_avail "$CRASHDIR")
if [ "$dir_size" -lt 10240 ]; then
comp_box "\033[33m$UG_ENABLE_LOW_MEM\033[0m"
read -r -p "$COMMON_INPUT_R" res
[ "$res" = 1 ] && {
BINDIR=/tmp/ShellCrash
sed -i "s#BINDIR=.*#BINDIR=$BINDIR" "$CRASHDIR"/configs/command.env
}
fi
# 启用推荐的自动任务配置
. "$CRASHDIR"/menus/5_task.sh && task_recom
# 提示导入订阅或者配置文件
if [ ! -s "$CRASHDIR"/yamls/config.yaml ] && [ ! -s "$CRASHDIR"/jsons/config.json ]; then
comp_box "\033[0m$UG_IMPORT_CONFIG\033[0m" \
"\033[32m$UG_CONFIG_TIP\033[0m" \
"$UG_CONFIG_RES"
btm_box "1) 立即导入" \
"0) 暂不导入"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && inuserguide=1 && {
. "$CRASHDIR"/menus/6_core_config.sh && set_core_config
inuserguide=""
}
fi
# 回到主界面
msg_alert "\033[36m$UG_FINAL_TIP\033[0m"
return 0
}

View File

@@ -28,7 +28,7 @@ stop_firewall(){
start_l(){ start_l(){
bfstart && { bfstart && {
. "$CRASHDIR"/starts/start_legacy.sh . "$CRASHDIR"/starts/start_legacy.sh
start_legacy "$COMMAND" 'shellcrash' start_legacy "$COMMAND" 'shellcrash'
} && afstart & } && afstart &
} }
@@ -65,7 +65,7 @@ start)
fi fi
;; ;;
stop) stop)
logger ShellCrash服务即将关闭...... logger ShellCrash服务即将关闭……
[ -n "$(pidof CrashCore)" ] && web_save #保存面板配置 [ -n "$(pidof CrashCore)" ] && web_save #保存面板配置
#清理定时任务 #清理定时任务
cronload | grep -vE '^$|start_legacy_wd.sh|运行时每' > "$TMPDIR"/cron_tmp cronload | grep -vE '^$|start_legacy_wd.sh|运行时每' > "$TMPDIR"/cron_tmp

View File

@@ -18,7 +18,7 @@
. "$CRASHDIR"/starts/check_geo.sh . "$CRASHDIR"/starts/check_geo.sh
. "$CRASHDIR"/starts/check_core.sh . "$CRASHDIR"/starts/check_core.sh
#缺省值 #缺省值
[ -z "$redir_mod" ] && [ "$USER" = "root" -o "$USER" = "admin" ] && redir_mod='Redir' [ -z "$redir_mod" ] && [ "$USER" = "root" -o "$USER" = "admin" ] && redir_mod='Redir模式'
[ -z "$dns_mod" ] && dns_mod='redir_host' [ -z "$dns_mod" ] && dns_mod='redir_host'
[ -z "$redir_mod" ] && firewall_area='4' [ -z "$redir_mod" ] && firewall_area='4'
routing_mark=$((fwmark + 2)) routing_mark=$((fwmark + 2))
@@ -97,10 +97,6 @@ fi
[ ! -s "$BINDIR"/ui/index.html ] && makehtml #如没有面板则创建跳转界面 [ ! -s "$BINDIR"/ui/index.html ] && makehtml #如没有面板则创建跳转界面
catpac #生成pac文件 catpac #生成pac文件
#内核及内核配置文件检查 #内核及内核配置文件检查
[ "$CRASHDIR" != "$BINDIR" ] && {
mkdir -p "$BINDIR"/providers
ln -sf "$CRASHDIR"/providers/* "$BINDIR"/providers/
}
if echo "$crashcore" | grep -q 'singbox'; then if echo "$crashcore" | grep -q 'singbox'; then
. "$CRASHDIR"/starts/singbox_check.sh && singbox_check . "$CRASHDIR"/starts/singbox_check.sh && singbox_check
[ -d "$TMPDIR"/jsons ] && rm -rf "$TMPDIR"/jsons/* || mkdir -p "$TMPDIR"/jsons #准备目录 [ -d "$TMPDIR"/jsons ] && rm -rf "$TMPDIR"/jsons/* || mkdir -p "$TMPDIR"/jsons #准备目录
@@ -139,7 +135,7 @@ fi
fi fi
} }
#加载系统内核组件 #加载系统内核组件
[ "$redir_mod" = "Tun" -o "$redir_mod" = "Mix" ] && ckcmd modprobe && modprobe tun 2>/dev/null [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && ckcmd modprobe && modprobe tun 2>/dev/null
#清理debug日志 #清理debug日志
rm -rf /tmp/ShellCrash/debug.log rm -rf /tmp/ShellCrash/debug.log
rm -rf "$CRASHDIR"/debug.log rm -rf "$CRASHDIR"/debug.log

View File

@@ -5,8 +5,8 @@ clash_check() { #clash启动前检查
#检测是否存在高级版规则或者tun模式 #检测是否存在高级版规则或者tun模式
if [ "$crashcore" = "clash" ]; then if [ "$crashcore" = "clash" ]; then
[ -n "$(cat $core_config | grep -aiE '^script:|proxy-providers|rule-providers|rule-set')" ] || [ -n "$(cat $core_config | grep -aiE '^script:|proxy-providers|rule-providers|rule-set')" ] ||
[ "$redir_mod" = "Mix" ] || [ "$redir_mod" = "混合模式" ] ||
[ "$redir_mod" = "Tun" ] && core_exchange meta '当前内核不支持的配置' [ "$redir_mod" = "Tun模式" ] && core_exchange meta '当前内核不支持的配置'
fi fi
[ "$crashcore" = "clash" ] && [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && [ -z "$(grep '0:7890' /etc/passwd)" ] && [ "$crashcore" = "clash" ] && [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && [ -z "$(grep '0:7890' /etc/passwd)" ] &&
core_exchange meta '当前内核不支持非root用户启用本机代理' core_exchange meta '当前内核不支持非root用户启用本机代理'

View File

@@ -6,7 +6,7 @@ modify_yaml() {
##########需要变更的配置########### ##########需要变更的配置###########
[ "$ipv6_dns" != "OFF" ] && dns_v6='true' || dns_v6='false' [ "$ipv6_dns" != "OFF" ] && dns_v6='true' || dns_v6='false'
external="external-controller: 0.0.0.0:$db_port" external="external-controller: 0.0.0.0:$db_port"
if [ "$redir_mod" = "Mix" -o "$redir_mod" = "Tun" ]; then if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ]; then
[ "$crashcore" = 'meta' ] && tun_meta=', device: utun, auto-route: false, auto-detect-interface: false' [ "$crashcore" = 'meta' ] && tun_meta=', device: utun, auto-route: false, auto-detect-interface: false'
tun="tun: {enable: true, stack: system$tun_meta}" tun="tun: {enable: true, stack: system$tun_meta}"
else else
@@ -15,7 +15,7 @@ modify_yaml() {
exper='experimental: {ignore-resolve-fail: true, interface-name: en0}' exper='experimental: {ignore-resolve-fail: true, interface-name: en0}'
#Meta内核专属配置 #Meta内核专属配置
[ "$crashcore" = 'meta' ] && { [ "$crashcore" = 'meta' ] && {
[ -z "$(grep 'PROCESS' "$CRASHDIR"/yamls/*.yaml)" ] && find_process='find-process-mode: "off"' [ "$redir_mod" != "纯净模式" ] && [ -z "$(grep 'PROCESS' "$CRASHDIR"/yamls/*.yaml)" ] && find_process='find-process-mode: "off"'
#ecs优化 #ecs优化
[ "$ecs_subnet" = ON ] && { [ "$ecs_subnet" = ON ] && {
. "$CRASHDIR"/libs/get_ecsip.sh . "$CRASHDIR"/libs/get_ecsip.sh

View File

@@ -6,7 +6,6 @@
. "$CRASHDIR"/libs/web_get_bin.sh . "$CRASHDIR"/libs/web_get_bin.sh
. "$CRASHDIR"/libs/compare.sh . "$CRASHDIR"/libs/compare.sh
. "$CRASHDIR"/libs/set_config.sh . "$CRASHDIR"/libs/set_config.sh
. "$CRASHDIR"/libs/logger.sh
update_servers() { #更新servers.list update_servers() { #更新servers.list
get_bin "$TMPDIR"/servers.list public/servers.list get_bin "$TMPDIR"/servers.list public/servers.list
@@ -15,9 +14,9 @@ update_servers() { #更新servers.list
gen_ua(){ #自动生成ua gen_ua(){ #自动生成ua
[ -z "$user_agent" -o "$user_agent" = "auto" ] && { [ -z "$user_agent" -o "$user_agent" = "auto" ] && {
if echo "$crashcore" | grep -q 'singbox'; then if echo "$crashcore" | grep -q 'singbox'; then
user_agent="sing-box/$core_v" user_agent="sing-box/singbox/$core_v"
elif [ "$crashcore" = meta ]; then elif [ "$crashcore" = meta ]; then
user_agent="clash.meta/mihomo" user_agent="clash.meta/mihomo/$core_v"
else else
user_agent="clash" user_agent="clash"
fi fi
@@ -47,7 +46,7 @@ get_core_config() { #下载内核配置文件
fi fi
#输出 #输出
echo "-----------------------------------------------" echo "-----------------------------------------------"
logger "正在连接服务器获取【$target】配置文件…………" 36 logger "正在连接服务器获取【$target】配置文件…………"
echo -e "链接地址为:\033[4;32m$Https\033[0m" echo -e "链接地址为:\033[4;32m$Https\033[0m"
echo 可以手动复制该链接到浏览器打开并查看数据是否正常! echo 可以手动复制该链接到浏览器打开并查看数据是否正常!
#获取在线config文件 #获取在线config文件

View File

@@ -170,7 +170,7 @@ start_iptables() { #iptables配置总入口
#启动公网访问防火墙 #启动公网访问防火墙
[ "$fw_wan" != OFF ] && start_ipt_wan [ "$fw_wan" != OFF ] && start_ipt_wan
#分模式设置流量劫持 #分模式设置流量劫持
[ "$redir_mod" = "Redir" -o "$redir_mod" = "Mix" ] && { [ "$redir_mod" = "Redir模式" -o "$redir_mod" = "混合模式" ] && {
JUMP="REDIRECT --to-ports $redir_port" #跳转劫持的具体命令 JUMP="REDIRECT --to-ports $redir_port" #跳转劫持的具体命令
[ "$lan_proxy" = true ] && { [ "$lan_proxy" = true ] && {
start_ipt_route iptables nat PREROUTING shellcrash tcp #ipv4-局域网tcp转发 start_ipt_route iptables nat PREROUTING shellcrash tcp #ipv4-局域网tcp转发
@@ -193,7 +193,7 @@ start_iptables() { #iptables配置总入口
} }
} }
} }
[ "$redir_mod" = "Tproxy" ] && { [ "$redir_mod" = "Tproxy模式" ] && {
modprobe xt_TPROXY >/dev/null 2>&1 modprobe xt_TPROXY >/dev/null 2>&1
JUMP="TPROXY --on-port $tproxy_port --tproxy-mark $fwmark" #跳转劫持的具体命令 JUMP="TPROXY --on-port $tproxy_port --tproxy-mark $fwmark" #跳转劫持的具体命令
if $iptable -j TPROXY -h 2>/dev/null | grep -q '\--on-port'; then if $iptable -j TPROXY -h 2>/dev/null | grep -q '\--on-port'; then
@@ -230,14 +230,14 @@ start_iptables() { #iptables配置总入口
fi fi
} }
} }
[ "$redir_mod" = "Tun" -o "$redir_mod" = "Mix" -o "$redir_mod" = "T&U旁路转发" -o "$redir_mod" = "TCP旁路转发" ] && { [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" -o "$redir_mod" = "T&U旁路转发" -o "$redir_mod" = "TCP旁路转发" ] && {
JUMP="MARK --set-mark $fwmark" #跳转劫持的具体命令 JUMP="MARK --set-mark $fwmark" #跳转劫持的具体命令
[ "$redir_mod" = "Tun" -o "$redir_mod" = "T&U旁路转发" ] && protocol=all [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "T&U旁路转发" ] && protocol=all
[ "$redir_mod" = "Mix" ] && protocol=udp [ "$redir_mod" = "混合模式" ] && protocol=udp
[ "$redir_mod" = "TCP旁路转发" ] && protocol=tcp [ "$redir_mod" = "TCP旁路转发" ] && protocol=tcp
if $iptable -j MARK -h 2>/dev/null | grep -q '\--set-mark'; then if $iptable -j MARK -h 2>/dev/null | grep -q '\--set-mark'; then
[ "$lan_proxy" = true ] && { [ "$lan_proxy" = true ] && {
[ "$redir_mod" = "Tun" -o "$redir_mod" = "Mix" ] && $iptable -I FORWARD -o utun -j ACCEPT [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && $iptable -I FORWARD -o utun -j ACCEPT
start_ipt_route iptables mangle PREROUTING shellcrash_mark $protocol start_ipt_route iptables mangle PREROUTING shellcrash_mark $protocol
} }
[ "$local_proxy" = true ] && start_ipt_route iptables mangle OUTPUT shellcrash_mark_out $protocol [ "$local_proxy" = true ] && start_ipt_route iptables mangle OUTPUT shellcrash_mark_out $protocol
@@ -247,7 +247,7 @@ start_iptables() { #iptables配置总入口
[ "$ipv6_redir" = "ON" ] && [ "$crashcore" != clashpre ] && { [ "$ipv6_redir" = "ON" ] && [ "$crashcore" != clashpre ] && {
if $ip6table -j MARK -h 2>/dev/null | grep -q '\--set-mark'; then if $ip6table -j MARK -h 2>/dev/null | grep -q '\--set-mark'; then
[ "$lan_proxy" = true ] && { [ "$lan_proxy" = true ] && {
[ "$redir_mod" = "Tun" -o "$redir_mod" = "Mix" ] && $ip6table -I FORWARD -o utun -j ACCEPT [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && $ip6table -I FORWARD -o utun -j ACCEPT
start_ipt_route ip6tables mangle PREROUTING shellcrashv6_mark $protocol start_ipt_route ip6tables mangle PREROUTING shellcrashv6_mark $protocol
} }
[ "$local_proxy" = true ] && start_ipt_route ip6tables mangle OUTPUT shellcrashv6_mark_out $protocol [ "$local_proxy" = true ] && start_ipt_route ip6tables mangle OUTPUT shellcrashv6_mark_out $protocol
@@ -275,16 +275,16 @@ start_iptables() { #iptables配置总入口
[ "$local_proxy" = true ] && start_ipt_dns iptables OUTPUT shellcrash_dns_out #ipv4-本机dns转发 [ "$local_proxy" = true ] && start_ipt_dns iptables OUTPUT shellcrash_dns_out #ipv4-本机dns转发
} }
#屏蔽QUIC #屏蔽QUIC
[ "$quic_rj" = 'ON' -a "$lan_proxy" = true -a "$redir_mod" != "Redir" ] && { [ "$quic_rj" = 'ON' -a "$lan_proxy" = true -a "$redir_mod" != "Redir模式" ] && {
[ "$dns_mod" != "fake-ip" -a "$cn_ip_route" = "ON" ] && { [ "$dns_mod" != "fake-ip" -a "$cn_ip_route" = "ON" ] && {
set_cn_ip='-m set ! --match-set cn_ip dst' set_cn_ip='-m set ! --match-set cn_ip dst'
set_cn_ip6='-m set ! --match-set cn_ip6 dst' set_cn_ip6='-m set ! --match-set cn_ip6 dst'
} }
[ "$redir_mod" = "Tun" -o "$redir_mod" = "Mix" ] && { [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && {
$iptable -I FORWARD -p udp --dport 443 -o utun $set_cn_ip -j REJECT >/dev/null 2>&1 $iptable -I FORWARD -p udp --dport 443 -o utun $set_cn_ip -j REJECT >/dev/null 2>&1
$ip6table -I FORWARD -p udp --dport 443 -o utun $set_cn_ip6 -j REJECT >/dev/null 2>&1 $ip6table -I FORWARD -p udp --dport 443 -o utun $set_cn_ip6 -j REJECT >/dev/null 2>&1
} }
[ "$redir_mod" = "Tproxy" ] && { [ "$redir_mod" = "Tproxy模式" ] && {
$iptable -I INPUT -p udp --dport 443 $set_cn_ip -j REJECT >/dev/null 2>&1 $iptable -I INPUT -p udp --dport 443 $set_cn_ip -j REJECT >/dev/null 2>&1
$ip6table -I INPUT -p udp --dport 443 $set_cn_ip6 -j REJECT >/dev/null 2>&1 $ip6table -I INPUT -p udp --dport 443 $set_cn_ip6 -j REJECT >/dev/null 2>&1
} }

View File

@@ -96,7 +96,7 @@ start_nft_route() { #nftables-route通用工具
#添加通用路由 #添加通用路由
nft add rule inet shellcrash "$1" "$JUMP" nft add rule inet shellcrash "$1" "$JUMP"
#处理特殊路由 #处理特殊路由
[ "$redir_mod" = "Mix" ] && { [ "$redir_mod" = "混合模式" ] && {
nft add rule inet shellcrash $1 meta l4proto tcp mark set $((fwmark + 1)) nft add rule inet shellcrash $1 meta l4proto tcp mark set $((fwmark + 1))
nft add chain inet shellcrash "$1"_mixtcp { type nat hook $2 priority -100 \; } nft add chain inet shellcrash "$1"_mixtcp { type nat hook $2 priority -100 \; }
nft add rule inet shellcrash "$1"_mixtcp mark $((fwmark + 1)) meta l4proto tcp redirect to $redir_port nft add rule inet shellcrash "$1"_mixtcp mark $((fwmark + 1)) meta l4proto tcp redirect to $redir_port
@@ -168,12 +168,12 @@ start_nftables() { #nftables配置总入口
[ "$local_proxy" = true ] && start_nft_dns output output #本机dns转发 [ "$local_proxy" = true ] && start_nft_dns output output #本机dns转发
} }
#分模式设置流量劫持 #分模式设置流量劫持
[ "$redir_mod" = "Redir" ] && { [ "$redir_mod" = "Redir模式" ] && {
JUMP="meta l4proto tcp redirect to $redir_port" #跳转劫持的具体命令 JUMP="meta l4proto tcp redirect to $redir_port" #跳转劫持的具体命令
[ "$lan_proxy" = true ] && start_nft_route prerouting prerouting nat -100 [ "$lan_proxy" = true ] && start_nft_route prerouting prerouting nat -100
[ "$local_proxy" = true ] && start_nft_route output output nat -100 [ "$local_proxy" = true ] && start_nft_route output output nat -100
} }
[ "$redir_mod" = "Tproxy" ] && (modprobe nft_tproxy >/dev/null 2>&1 || lsmod 2>/dev/null | grep -q nft_tproxy) && { [ "$redir_mod" = "Tproxy模式" ] && (modprobe nft_tproxy >/dev/null 2>&1 || lsmod 2>/dev/null | grep -q nft_tproxy) && {
JUMP="meta l4proto {tcp, udp} mark set $fwmark tproxy to :$tproxy_port" #跳转劫持的具体命令 JUMP="meta l4proto {tcp, udp} mark set $fwmark tproxy to :$tproxy_port" #跳转劫持的具体命令
[ "$lan_proxy" = true ] && start_nft_route prerouting prerouting filter -150 [ "$lan_proxy" = true ] && start_nft_route prerouting prerouting filter -150
[ "$local_proxy" = true ] && { [ "$local_proxy" = true ] && {
@@ -184,8 +184,8 @@ start_nftables() { #nftables配置总入口
} }
} }
[ "$tun_statu" = true ] && { [ "$tun_statu" = true ] && {
[ "$redir_mod" = "Tun" ] && JUMP="meta l4proto {tcp, udp} mark set $fwmark" #跳转劫持的具体命令 [ "$redir_mod" = "Tun模式" ] && JUMP="meta l4proto {tcp, udp} mark set $fwmark" #跳转劫持的具体命令
[ "$redir_mod" = "Mix" ] && JUMP="meta l4proto udp mark set $fwmark" #跳转劫持的具体命令 [ "$redir_mod" = "混合模式" ] && JUMP="meta l4proto udp mark set $fwmark" #跳转劫持的具体命令
[ "$lan_proxy" = true ] && { [ "$lan_proxy" = true ] && {
start_nft_route prerouting prerouting filter -150 start_nft_route prerouting prerouting filter -150
#放行流量 #放行流量

View File

@@ -8,14 +8,14 @@
[ -z "$common_ports" ] && common_ports='ON' [ -z "$common_ports" ] && common_ports='ON'
[ -z "$multiport" ] && multiport='22,80,443,8080,8443' [ -z "$multiport" ] && multiport='22,80,443,8080,8443'
[ "$common_ports" = "ON" ] && ports="-m multiport --dports $multiport" [ "$common_ports" = "ON" ] && ports="-m multiport --dports $multiport"
[ -z "$redir_mod" ] && [ "$USER" = "root" -o "$USER" = "admin" ] && redir_mod='Redir' [ -z "$redir_mod" ] && [ "$USER" = "root" -o "$USER" = "admin" ] && redir_mod='Redir模式'
[ -z "$dns_mod" ] && dns_mod='redir_host' [ -z "$dns_mod" ] && dns_mod='redir_host'
[ -z "$redir_mod" ] && firewall_area='4' [ -z "$redir_mod" ] && firewall_area='4'
#设置策略路由 #设置策略路由
[ "$firewall_area" != 4 ] && { [ "$firewall_area" != 4 ] && {
[ "$redir_mod" = "Tproxy" ] && ip route add local default dev lo table $table 2>/dev/null [ "$redir_mod" = "Tproxy模式" ] && ip route add local default dev lo table $table 2>/dev/null
[ "$redir_mod" = "Tun" -o "$redir_mod" = "Mix" ] && { [ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && {
i=1 i=1
while [ -z "$(ip route list | grep utun)" -a "$i" -le 29 ]; do while [ -z "$(ip route list | grep utun)" -a "$i" -le 29 ]; do
sleep 1 sleep 1
@@ -28,13 +28,13 @@
fi fi
} }
[ "$firewall_area" = 5 ] && ip route add default via $bypass_host table $table 2>/dev/null [ "$firewall_area" = 5 ] && ip route add default via $bypass_host table $table 2>/dev/null
[ "$redir_mod" != "Redir" ] && ip rule add fwmark $fwmark table $table 2>/dev/null [ "$redir_mod" != "Redir模式" ] && ip rule add fwmark $fwmark table $table 2>/dev/null
} }
#添加ipv6路由 #添加ipv6路由
[ "$ipv6_redir" = "ON" -a "$firewall_area" -le 3 ] && { [ "$ipv6_redir" = "ON" -a "$firewall_area" -le 3 ] && {
[ "$redir_mod" = "Tproxy" ] && ip -6 route add local default dev lo table $((table + 1)) 2>/dev/null [ "$redir_mod" = "Tproxy模式" ] && ip -6 route add local default dev lo table $((table + 1)) 2>/dev/null
[ -n "$(ip route list | grep utun)" ] && ip -6 route add default dev utun table $((table + 1)) 2>/dev/null [ -n "$(ip route list | grep utun)" ] && ip -6 route add default dev utun table $((table + 1)) 2>/dev/null
[ "$redir_mod" != "Redir" ] && ip -6 rule add fwmark $fwmark table $((table + 1)) 2>/dev/null [ "$redir_mod" != "Redir模式" ] && ip -6 rule add fwmark $fwmark table $((table + 1)) 2>/dev/null
} }
#判断代理用途 #判断代理用途
[ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && local_proxy=true [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && local_proxy=true

View File

@@ -201,19 +201,19 @@ EOF
#生成add_route.json #生成add_route.json
#域名嗅探配置 #域名嗅探配置
[ "$sniffer" != OFF ] && sniffer_set='{ "action": "sniff", "timeout": "500ms" },' [ "$sniffer" != OFF ] && sniffer_set='{ "action": "sniff", "timeout": "500ms" },'
[ "$ts_service" = ON ] && tailscale_set='{ "inbound": [ "ts-ep" ], "port": 53, "action": "hijack-dns" },' [ "$ts_service" = ON ] && tailscale_set='{ "inbound": [ "ts-ep" ], "port": 53, "action": "hijack-dns" },'
cat >"$TMPDIR"/jsons/add_route.json <<EOF cat >"$TMPDIR"/jsons/add_route.json <<EOF
{ {
"route": { "route": {
"default_domain_resolver": "dns_resolver", "default_domain_resolver": "dns_resolver",
"default_mark": $routing_mark, "default_mark": $routing_mark,
"rules": [ "rules": [
{ "inbound": [ "dns-in" ], "action": "hijack-dns" }, { "inbound": [ "dns-in" ], "action": "hijack-dns" },
$tailscale_set $tailscale_set
$sniffer_set $sniffer_set
{ "clash_mode": "Direct" , "outbound": "DIRECT" }, { "clash_mode": "Direct" , "outbound": "DIRECT" },
{ "clash_mode": "Global" , "outbound": "GLOBAL" } { "clash_mode": "Global" , "outbound": "GLOBAL" }
] ]
} }
} }
EOF EOF
@@ -267,7 +267,7 @@ EOF
. "$CRASHDIR"/configs/gateway.cfg . "$CRASHDIR"/configs/gateway.cfg
. "$CRASHDIR"/libs/sb_inbounds.sh . "$CRASHDIR"/libs/sb_inbounds.sh
} }
if [ "$redir_mod" = "Mix" -o "$redir_mod" = "Tun" ]; then if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ]; then
[ "ipv6_redir" = 'ON' ] && ipv6_address='"fe80::e5c5:2469:d09b:609a/64",' [ "ipv6_redir" = 'ON' ] && ipv6_address='"fe80::e5c5:2469:d09b:609a/64",'
cat >>"$TMPDIR"/jsons/tun.json <<EOF cat >>"$TMPDIR"/jsons/tun.json <<EOF
{ {

View File

@@ -1 +1 @@
1.9.5alpha11 1.9.4release