mirror of
https://github.com/fscarmen/sing-box.git
synced 2026-08-10 17:55:16 +08:00
feat: add Armbian support to system detection
- add Armbian detection and mapping logic in system identification - update error messages to include Armbian in supported systems feat: 增加对 Armbian 系统的支持 - 在系统识别逻辑中添加对 Armbian 的检测与映射 - 更新错误提示信息,在支持系统中包含 Armbian
This commit is contained in:
@@ -151,7 +151,7 @@
|
||||
* 节点信息输出到 V2rayN / Clash Verge / 小火箭 / Nekobox / Sing-box (SFI, SFA, SFM),订阅自动适配客户端,一个订阅 url 走天下
|
||||
* 自定义端口,适合有限开放端口的 nat 小鸡
|
||||
* 内置 warp 链式代理解锁 chatGPT
|
||||
* 智能判断操作系统: Ubuntu 、Debian 、CentOS 、Alpine 和 Arch Linux,请务必选择 LTS 系统
|
||||
* 智能判断操作系统: Ubuntu 、Debian 、CentOS 、Alpine 、Armbian 和 Arch Linux,请务必选择 LTS 系统
|
||||
* 支持硬件结构类型: AMD 和 ARM,支持 IPv4 和 IPv6
|
||||
* 无交互极速安排模式: 一个回车完成 11 个协议的安装
|
||||
|
||||
|
||||
+15
-2
@@ -47,8 +47,8 @@ E[3]="Input errors up to 5 times.The script is aborted."
|
||||
C[3]="输入错误达5次,脚本退出"
|
||||
E[4]="UUID should be 36 characters, please re-enter (\${UUID_ERROR_TIME} times remaining):"
|
||||
C[4]="UUID 应为36位字符,请重新输入 (剩余\${UUID_ERROR_TIME}次):"
|
||||
E[5]="The script supports Debian, Ubuntu, CentOS, Alpine, Fedora or Arch systems only. Feedback: [https://github.com/fscarmen/sing-box/issues]"
|
||||
C[5]="本脚本只支持 Debian、Ubuntu、CentOS、Alpine、Fedora 或 Arch 系统,问题反馈:[https://github.com/fscarmen/sing-box/issues]"
|
||||
E[5]="The script supports Debian, Ubuntu, CentOS, Alpine, Armbian, Fedora or Arch systems only. Feedback: [https://github.com/fscarmen/sing-box/issues]"
|
||||
C[5]="本脚本只支持 Debian、Ubuntu、CentOS、Alpine、Armbian、Fedora 或 Arch 系统,问题反馈:[https://github.com/fscarmen/sing-box/issues]"
|
||||
E[6]="Curren operating system is \$SYS.\\\n The system lower than \$SYSTEM \${MAJOR[int]} is not supported. Feedback: [https://github.com/fscarmen/sing-box/issues]"
|
||||
C[6]="当前操作是 \$SYS\\\n 不支持 \$SYSTEM \${MAJOR[int]} 以下系统,问题反馈:[https://github.com/fscarmen/sing-box/issues]"
|
||||
E[7]="Install dependence-list:"
|
||||
@@ -1553,6 +1553,8 @@ cmd_systemctl() {
|
||||
|
||||
check_system_info() {
|
||||
[ -s /etc/os-release ] && SYS="$(awk -F '"' 'tolower($0) ~ /pretty_name/{print $2}' /etc/os-release)"
|
||||
[ -s /etc/os-release ] && OS_ID="$(awk -F '=' 'tolower($1) == "id" {gsub(/"/, "", $2); print tolower($2)}' /etc/os-release)"
|
||||
[ -s /etc/os-release ] && OS_LIKE="$(awk -F '=' 'tolower($1) == "id_like" {gsub(/"/, "", $2); print tolower($2)}' /etc/os-release)"
|
||||
[[ -z "$SYS" ]] && command -v hostnamectl >/dev/null 2>&1 && SYS="$(hostnamectl | awk -F ': ' 'tolower($0) ~ /operating system/{print $2}')"
|
||||
[[ -z "$SYS" ]] && command -v lsb_release >/dev/null 2>&1 && SYS="$(lsb_release -sd)"
|
||||
[[ -z "$SYS" && -s /etc/lsb-release ]] && SYS="$(awk -F '"' 'tolower($0) ~ /distrib_description/{print $2}' /etc/lsb-release)"
|
||||
@@ -1567,9 +1569,20 @@ check_system_info() {
|
||||
PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "pacman -S --noconfirm" "apk add --no-cache" "dnf -y install")
|
||||
PACKAGE_UNINSTALL=("apt -y autoremove" "apt -y autoremove" "yum -y autoremove" "pacman -Rcnsu --noconfirm" "apk del -f" "dnf -y autoremove")
|
||||
|
||||
if [ "$OS_ID" = 'armbian' ]; then
|
||||
if [[ "$OS_LIKE" =~ ubuntu ]]; then
|
||||
SYSTEM='Ubuntu'
|
||||
int=1
|
||||
else
|
||||
SYSTEM='Debian'
|
||||
int=0
|
||||
fi
|
||||
SYS="${SYS:-Armbian}"
|
||||
else
|
||||
for int in "${!REGEX[@]}"; do
|
||||
[[ "${SYS,,}" =~ ${REGEX[int]} ]] && SYSTEM="${RELEASE[int]}" && break
|
||||
done
|
||||
fi
|
||||
|
||||
# 针对各厂商的订制系统
|
||||
if [ -z "$SYSTEM" ]; then
|
||||
|
||||
Reference in New Issue
Block a user