文件
scripts/singbox/README.md
2026-04-26 18:58:14 +08:00

68 行
1.5 KiB
Markdown

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

# singbox.sh
交互式管理脚本。下方仅记录安装与运行方式。
## 系统要求
- Linux x86_64 / ARMv7 / ARM64 / AMD64v3 / s390x
- 使用 systemd 的发行版Debian 10+ / Ubuntu 20.04+ / CentOS 8+ / Rocky / AlmaLinux 等)
- root 权限
## 依赖安装
脚本运行依赖以下命令(多数发行版默认包含 `bash` `tar` `systemctl` `iptables` 等):
| 依赖 | 用途 |
| --- | --- |
| `curl` / `wget` | 下载与 API 调用 |
| `jq` | 解析 JSON |
| `openssl` | 生成密钥、自签证书 |
| `tar` | 解压 |
| `systemd` | 服务管理 |
| `cron` (`cronie` / `crontabs`) | 定时任务 |
### Debian / Ubuntu
```bash
apt update
apt install -y curl wget jq openssl tar cron
```
### CentOS / RHEL / Rocky / Alma
```bash
dnf install -y curl wget jq openssl tar cronie
systemctl enable --now crond
```
### Arch Linux
```bash
pacman -Sy --noconfirm curl wget jq openssl tar cronie
systemctl enable --now cronie
```
## 一键执行
```bash
bash <(curl -fsSL https://git.suhang.me/suhang/scripts/raw/branch/release/singbox/singbox.sh)
```
或使用 `wget`
```bash
bash <(wget -qO- https://git.suhang.me/suhang/scripts/raw/branch/release/singbox/singbox.sh)
```
## 定时任务
脚本会自动写入 crontab,每周一凌晨 2 点执行 `18`(续签证书):
```cron
0 2 * * 1 /bin/bash /root/singbox.sh >> /usr/local/etc/certificate.log 2>&1
```
## 卸载
进入菜单后选择卸载选项即可移除二进制、配置目录与 systemd 服务。