# script
**Repository Path**: jun-wan/script
## Basic Information
- **Project Name**: script
- **Description**: 一些可能能够用到的脚本
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 3
- **Forks**: 5
- **Created**: 2025-10-28
- **Last Updated**: 2026-04-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: Bash, Powershell, Linux, Docker, Windows
## README
> 这个仓库主要收录我自己常用的一键部署脚本、系统工具脚本和一些偏 NAS / Docker 的实用小工具。整体偏中文交互、实用优先,能少折腾就少折腾。
## 目录
| 序号 | 名称 | 简介作用 | 在线执行 |
|------|------|----------|----------|
| 1 | [KWRT 软件源配置脚本](#1-kwrt-软件源配置脚本) | 自动配置 KWRT OpenWrt 官方软件源 | [执行](#在线直接执行) |
| 2 | [Wi-Fi 限速管理脚本](#2-wi-fi-限速管理脚本) | 管理 Wi-Fi 设备的限速规则 | [执行](#脚本菜单说明) |
| 3 | [Swap 分区自动配置脚本](#3-swap-分区自动配置脚本) | 一键创建512MB swap 分区 | [执行](#在线直接执行-1) |
| 4 | [虚拟内存交互管理脚本](#4-虚拟内存交互管理脚本) | 交互式虚拟内存管理工具,支持自定义位置和大小 | [执行](#4-虚拟内存交互管理脚本) |
| 5 | [Docker 完全清理脚本](#5-docker-完全清理脚本) | 清空所有 Docker 数据恢复初始状态 | [执行](#在线直接执行推荐) |
| 6 | [AstrBot 一键部署脚本](#6-astrbot-一键部署脚本) | 跨平台一键部署 AstrBot Docker 容器 | [执行](#在线直接执行推荐-2) |
| 7 | [玩客云 Armbian 初始化脚本](#7-玩客云-armbian-初始化脚本) | 一键初始化玩客云 Armbian 系统 | [执行](#在线直接执行-2) |
| 8 | [RK3566 FnOS ARM 一键管理工具](#8-rk3566-fnos-arm-一键管理工具) | 三系统切换、系统升级、LED 控制 | [执行](#在线直接执行-3) |
| 9 | [Docker 端口冲突修复脚本](#9-docker-端口冲突修复脚本) | 修复 Windows Docker 端口绑定失败 | [执行](#在线直接执行-4) |
| 10 | [Docker Engine 安装脚本](#10-docker-engine-安装脚本) | 一键安装 Docker Engine 及相关组件 | [执行](#在线直接执行-5) |
| 11 | [斐讯 N1 飞牛 NAS WIFI 固件安装脚本](#11-斐讯-n1-飞牛-nas-wifi-固件安装脚本) | 为斐讯 N1 安装的飞牛 NAS 安装 WIFI 驱动固件 | [执行](#在线直接执行-6) |
| 12 | [Miloco 获取设备ID脚本](#12-miloco-获取设备id脚本) | 小米摄像头控制中心一键部署,获取设备 ID | [执行](#快速部署) |
| 13 | [Micam 一键部署脚本](#13-micam-一键部署脚本) | 小米摄像头 RTSP 桥接服务一键部署到 NAS | [执行](#快速部署) |
| 14 | [Chatwoot Docker 一键部署脚本](#14-chatwoot-docker-一键部署脚本) | 开源客服系统 Chatwoot 一键部署到服务器 | [执行](#在线直接执行-7) |
| 15 | [SSH Known Hosts 清理脚本](#15-ssh-known-hosts-清理脚本) | 快捷清除 Windows SSH 的 known_hosts 记录 | [执行](#在线直接执行-8) |
| 16 | [Bolo 博客一键部署脚本](#bolo-blog-deploy) | 一键部署 Bolo 博客系统和 MySQL 数据库 | [执行](#bolo-blog-deploy) |
| 17 | [TDuck 表单系统一键部署脚本](#17-tduck-表单系统一键部署脚本) | 一键部署 TDuck 表单系统和 MySQL 数据库 | [执行](#17-tduck-表单系统一键部署脚本) |
| 18 | [RustDesk 一键部署脚本](#18-rustdesk-一键部署脚本) | 一键部署 RustDesk + WebUI 服务端 | [执行](#18-rustdesk-一键部署脚本) |
| 19 | [new-api Docker 部署脚本](#19-new-api-docker-部署脚本) | 交互式或无交互部署 new-api,支持 SQLite 单机版和 PostgreSQL + Redis | [执行](#19-new-api-docker-部署脚本) |
| 20 | [飞牛 NAS 洛雪音乐网页版一键部署脚本](#20-飞牛-nas-洛雪音乐网页版一键部署脚本) | 飞牛 NAS(fnOS)环境下无交互部署洛雪音乐网页版 | [执行](#20-飞牛-nas-洛雪音乐网页版一键部署脚本) |
| 21 | [Sub2API Docker 一键部署脚本](#21-sub2api-docker-一键部署脚本) | 交互式部署 / 卸载 Sub2API,支持自动检测磁盘与自动抓取管理员密码 | [执行](#21-sub2api-docker-一键部署脚本) |
| 22 | [CLIProxyAPI Docker 一键部署脚本](#22-cliproxyapi-docker-一键部署脚本) | 交互式部署 / 卸载 CLIProxyAPI,支持自动检测磁盘、国内镜像回退和管理面板配置 | [执行](#22-cliproxyapi-docker-一键部署脚本) |
---
> 这里只保留快速执行命令,完整介绍、参数说明和注意事项见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md)。
> 建议先下载脚本并阅读源码,确认无误后再在自有设备或授权环境中执行。
## 1. KWRT 软件源配置脚本
> **适用:OpenWrt / KWRT** - 自动配置软件源,方便后续安装和更新软件包。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#1-kwrt-软件源配置脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/kwrt/update_opkg_feeds.sh -o /tmp/update_opkg_feeds.sh && sh /tmp/update_opkg_feeds.sh
```
---
## 2. Wi-Fi 限速管理脚本
> **适用:OpenWrt / Linux 网络环境** - 管理自有路由器或测试网络中的 Wi-Fi 设备带宽规则。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#2-wi-fi-限速管理脚本)
### 脚本菜单说明
```bash
wget -O wifi_ip_limit.sh https://gitee.com/jun-wan/script/raw/master/ip-limit/wifi_ip_limit.sh && chmod +x wifi_ip_limit.sh && ./wifi_ip_limit.sh
```
---
## 3. Swap 分区自动配置脚本
> **适用:Linux** - 自动创建并启用基础交换空间,适合内存较小的设备。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#3-swap-分区自动配置脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/swap/auto_setup_swap.sh -o /tmp/auto_setup_swap.sh && sh /tmp/auto_setup_swap.sh
```
---
## 4. 虚拟内存交互管理脚本
> **适用:Linux** - 提供交互式菜单,用于创建、查看和移除交换文件。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#4-虚拟内存交互管理脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/swap-manager/virtual_memory_manager.sh -o /tmp/virtual_memory_manager.sh && chmod +x /tmp/virtual_memory_manager.sh && /tmp/virtual_memory_manager.sh
```
---
## 5. Docker 完全清理脚本
> **适用:Linux / Windows + Docker** - 清理本机 Docker 测试环境,执行前请确认数据已备份。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#5-docker-完全清理脚本)
### 在线直接执行推荐
#### Linux 交互确认
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/linux-docker-clean/docker_clean_all.sh -o /tmp/docker_clean_all.sh && chmod +x /tmp/docker_clean_all.sh && /tmp/docker_clean_all.sh
```
#### Linux 跳过确认
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/linux-docker-clean/docker_clean_all.sh -o /tmp/docker_clean_all.sh && chmod +x /tmp/docker_clean_all.sh && /tmp/docker_clean_all.sh -y
```
#### Windows PowerShell
```powershell
irm https://gitee.com/jun-wan/script/raw/master/windows-docker-clean/docker_clean_all.ps1 -OutFile docker_clean_all.ps1; powershell -ExecutionPolicy Bypass -File .\docker_clean_all.ps1
```
---
## 6. AstrBot 一键部署脚本
> **适用:Linux / Windows + Docker** - 辅助在自有服务器或 NAS 上部署 AstrBot Docker 服务。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#6-astrbot-一键部署脚本)
### 在线直接执行推荐
#### Linux / NAS
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/astrbot/deploy_astrbot.sh -o /tmp/deploy_astrbot.sh && chmod +x /tmp/deploy_astrbot.sh && /tmp/deploy_astrbot.sh
```
#### Windows PowerShell
```powershell
irm https://gitee.com/jun-wan/script/raw/master/astrbot/deploy_astrbot.ps1 -OutFile deploy_astrbot.ps1; powershell -ExecutionPolicy Bypass -File .\deploy_astrbot.ps1
```
---
## 7. 玩客云 Armbian 初始化脚本
> **适用:Armbian / Linux ARM** - 初始化自有玩客云 Armbian 系统的基础环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#7-玩客云-armbian-初始化脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/onecloud/armbian_init.sh -o /tmp/armbian_init.sh && chmod +x /tmp/armbian_init.sh && /tmp/armbian_init.sh
```
---
## 8. RK3566 FnOS ARM 一键管理工具
> **适用:FnOS / Linux ARM** - 面向 RK3566 / FnOS ARM 设备的系统管理辅助工具。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#8-rk3566-fnos-arm-一键管理工具)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/rk3566-fnos-arm-tools/xxfn-tool.sh -o /tmp/xxfn-tool.sh && chmod +x /tmp/xxfn-tool.sh && /tmp/xxfn-tool.sh
```
---
## 9. Docker 端口冲突修复脚本
> **适用:Windows + Docker Desktop** - 排查和修复 Windows 本机 Docker 端口绑定异常。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#9-docker-端口冲突修复脚本)
### 在线直接执行
```powershell
irm https://gitee.com/jun-wan/script/raw/master/fix-docker-ports/fix_docker_ports.ps1 -OutFile fix_docker_ports.ps1; powershell -ExecutionPolicy Bypass -File .\fix_docker_ports.ps1
```
---
## 10. Docker Engine 安装脚本
> **适用:Linux** - 自动安装 Docker Engine 及常用组件,适合服务器初始化。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#10-docker-engine-安装脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/docker-install/install_docker.sh -o /tmp/install_docker.sh && chmod +x /tmp/install_docker.sh && /tmp/install_docker.sh
```
---
## 11. 斐讯 N1 飞牛 NAS WIFI 固件安装脚本
> **适用:飞牛 NAS / Linux ARM** - 为自有 N1 / 飞牛 NAS 环境补充无线相关驱动文件。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#11-斐讯-n1-飞牛-nas-wifi-固件安装脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/fnos-wifi-firmware/install_wifi_firmware.sh -o /tmp/install_wifi_firmware.sh && chmod +x /tmp/install_wifi_firmware.sh && /tmp/install_wifi_firmware.sh
```
---
## 12. Miloco 获取设备ID脚本
> **适用:Linux / NAS** - 查看自有局域网设备的基础识别信息。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#12-miloco-获取设备id脚本)
### 快速部署
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/micam-deploy/miloco-get-did.sh -o /tmp/miloco-get-did.sh && chmod +x /tmp/miloco-get-did.sh && /tmp/miloco-get-did.sh
```
---
## 13. Micam 一键部署脚本
> **适用:Linux / NAS + Docker** - 辅助部署自用局域网媒体服务,适合 NAS 测试环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#13-micam-一键部署脚本)
### 快速部署
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/micam-deploy/deploy-micam.sh -o /tmp/deploy-micam.sh && chmod +x /tmp/deploy-micam.sh && /tmp/deploy-micam.sh
```
---
## 14. Chatwoot Docker 一键部署脚本
> **适用:Linux + Docker** - 快速部署 Chatwoot 开源客服系统测试环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#14-chatwoot-docker-一键部署脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/chatwoot_docker/deploy.sh -o /tmp/chatwoot_deploy.sh && chmod +x /tmp/chatwoot_deploy.sh && /tmp/chatwoot_deploy.sh
```
---
## 15. SSH Known Hosts 清理脚本
> **适用:Windows** - 清理本机 SSH known_hosts 历史记录。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#15-ssh-known-hosts-清理脚本)
### 在线直接执行
#### PowerShell 交互模式
```powershell
irm https://gitee.com/jun-wan/script/raw/master/ssh_cleaner/clean_ssh.ps1 -OutFile clean_ssh.ps1; powershell -ExecutionPolicy Bypass -File .\clean_ssh.ps1
```
#### PowerShell 指定主机
```powershell
irm https://gitee.com/jun-wan/script/raw/master/ssh_cleaner/clean_ssh.ps1 -OutFile clean_ssh.ps1; powershell -ExecutionPolicy Bypass -File .\clean_ssh.ps1 192.168.1.10
```
#### CMD / BAT
```bat
curl.exe -L https://gitee.com/jun-wan/script/raw/master/ssh_cleaner/clean_ssh.bat -o clean_ssh.bat && clean_ssh.bat
```
---
## 16. Bolo 博客一键部署脚本
> **适用:Linux / Windows + Docker** - 部署 Bolo 个人博客及配套数据库测试环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#bolo-blog-deploy)
### 在线直接执行
#### Linux / NAS
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/bolo_blog_deploy/deploy.sh -o /tmp/bolo_deploy.sh && chmod +x /tmp/bolo_deploy.sh && /tmp/bolo_deploy.sh
```
#### Windows PowerShell
```powershell
irm https://gitee.com/jun-wan/script/raw/master/bolo_blog_deploy/deploy.ps1 -OutFile deploy.ps1; powershell -ExecutionPolicy Bypass -File .\deploy.ps1
```
---
## 17. TDuck 表单系统一键部署脚本
> **适用:Linux + Docker** - 部署 TDuck 开源表单系统测试环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#17-tduck-表单系统一键部署脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/tduck_deploy/deploy-tduck.sh -o /tmp/deploy-tduck.sh && chmod +x /tmp/deploy-tduck.sh && /tmp/deploy-tduck.sh
```
---
## 18. RustDesk 一键部署脚本
> **适用:Linux + Docker** - 部署自用远程协助服务端,请仅在授权场景使用。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#18-rustdesk-一键部署脚本)
### 在线直接执行
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/rustdesk_deploy/install_rustdesk.sh -o /tmp/install_rustdesk.sh && chmod +x /tmp/install_rustdesk.sh && /tmp/install_rustdesk.sh
```
---
## 19. new-api Docker 部署脚本
> **适用:Linux + Docker** - 部署自用 API 管理服务测试环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#19-new-api-docker-部署脚本)
### 在线直接执行
#### 交互式部署 / 重装 / 卸载
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/new_api_deploy/deploy.sh -o /tmp/new_api_deploy.sh && chmod +x /tmp/new_api_deploy.sh && /tmp/new_api_deploy.sh
```
#### 直接进入部署流程
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/new_api_deploy/deploy.sh -o /tmp/new_api_deploy.sh && chmod +x /tmp/new_api_deploy.sh && /tmp/new_api_deploy.sh deploy
```
#### 直接进入卸载流程
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/new_api_deploy/deploy.sh -o /tmp/new_api_deploy.sh && chmod +x /tmp/new_api_deploy.sh && /tmp/new_api_deploy.sh uninstall
```
#### SQLite 单机版
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/new_api_deploy/deploy_sqlite.sh -o /tmp/deploy_sqlite.sh && chmod +x /tmp/deploy_sqlite.sh && /tmp/deploy_sqlite.sh
```
#### SQLite 单机版无交互
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/new_api_deploy/deploy_sqlite.sh -o /tmp/deploy_sqlite.sh && chmod +x /tmp/deploy_sqlite.sh && INSTALL_DIR=/data/new-api PORT=3002 /tmp/deploy_sqlite.sh
```
---
## 20. 飞牛 NAS 洛雪音乐网页版一键部署脚本
> **适用:飞牛 NAS / Linux + Docker** - 在飞牛 NAS 上部署自用 Web 应用测试环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#20-飞牛-nas-洛雪音乐网页版一键部署脚本)
### 在线直接执行
#### 交互式部署
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/lxmusic_fnos/deploy_lxmusic_fnos.sh -o /tmp/deploy_lxmusic_fnos.sh && chmod +x /tmp/deploy_lxmusic_fnos.sh && /tmp/deploy_lxmusic_fnos.sh
```
#### 无交互部署
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/lxmusic_fnos/deploy_lxmusic_fnos.sh -o /tmp/deploy_lxmusic_fnos.sh && chmod +x /tmp/deploy_lxmusic_fnos.sh && /tmp/deploy_lxmusic_fnos.sh --non-interactive
```
#### 无交互并指定端口
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/lxmusic_fnos/deploy_lxmusic_fnos.sh -o /tmp/deploy_lxmusic_fnos.sh && chmod +x /tmp/deploy_lxmusic_fnos.sh && /tmp/deploy_lxmusic_fnos.sh -y --host-port 9528
```
---
## 21. Sub2API Docker 一键部署脚本
> **适用:Linux + Docker** - 部署自用 API 服务组合测试环境。
详见:[SCRIPT_DETAILS.md](SCRIPT_DETAILS.md#21-sub2api-docker-一键部署脚本)
### 在线直接执行
#### 菜单模式
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/sub2api_deploy/deploy.sh -o /tmp/sub2api_deploy.sh && chmod +x /tmp/sub2api_deploy.sh && /tmp/sub2api_deploy.sh
```
#### 直接进入部署流程
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/sub2api_deploy/deploy.sh -o /tmp/sub2api_deploy.sh && chmod +x /tmp/sub2api_deploy.sh && /tmp/sub2api_deploy.sh deploy
```
#### 直接进入卸载流程
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/sub2api_deploy/deploy.sh -o /tmp/sub2api_deploy.sh && chmod +x /tmp/sub2api_deploy.sh && /tmp/sub2api_deploy.sh uninstall
```
---
## 22. CLIProxyAPI Docker 一键部署脚本
> **适用:Linux + Docker / NAS** - 交互式部署 CLIProxyAPI,自动选择安装磁盘,优先使用 `docker.1ms.run/` 国内镜像前缀,失败自动回退官方镜像,并生成管理面板登录信息。
### 在线直接执行
#### 菜单模式
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/cliproxyapi_deploy/cpa_docker_deploy.sh -o /tmp/cpa_docker_deploy.sh && chmod +x /tmp/cpa_docker_deploy.sh && /tmp/cpa_docker_deploy.sh
```
#### 直接进入部署流程
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/cliproxyapi_deploy/cpa_docker_deploy.sh -o /tmp/cpa_docker_deploy.sh && chmod +x /tmp/cpa_docker_deploy.sh && /tmp/cpa_docker_deploy.sh deploy
```
#### 直接进入卸载流程
```bash
curl -fsSL https://gitee.com/jun-wan/script/raw/master/cliproxyapi_deploy/cpa_docker_deploy.sh -o /tmp/cpa_docker_deploy.sh && chmod +x /tmp/cpa_docker_deploy.sh && /tmp/cpa_docker_deploy.sh uninstall
```