Update sb.sh

This commit is contained in:
甬哥侃侃侃ygkkk
2026-04-09 10:21:36 +08:00
committed by GitHub
parent e35a08f9dc
commit 6a7a5c2438
+4 -4
View File
@@ -34,7 +34,7 @@ else
red "脚本不支持当前的系统,请选择使用Ubuntu,Debian,Centos系统。" && exit red "脚本不支持当前的系统,请选择使用Ubuntu,Debian,Centos系统。" && exit
fi fi
export sbfiles="/etc/s-box/sb10.json /etc/s-box/sb11.json /etc/s-box/sb.json" export sbfiles="/etc/s-box/sb10.json /etc/s-box/sb11.json /etc/s-box/sb.json"
export sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' | cut -d '.' -f 1,2 2>/dev/null) export sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' 2>/dev/null | cut -d '.' -f 1,2)
vsid=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1) vsid=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1)
op=$(cat /etc/redhat-release 2>/dev/null || cat /etc/os-release 2>/dev/null | grep -i pretty_name | cut -d \" -f2) op=$(cat /etc/redhat-release 2>/dev/null || cat /etc/os-release 2>/dev/null | grep -i pretty_name | cut -d \" -f2)
#if [[ $(echo "$op" | grep -i -E "arch|alpine") ]]; then #if [[ $(echo "$op" | grep -i -E "arch|alpine") ]]; then
@@ -227,7 +227,7 @@ if [[ -f '/etc/s-box/sing-box' ]]; then
chown root:root /etc/s-box/sing-box chown root:root /etc/s-box/sing-box
chmod +x /etc/s-box/sing-box chmod +x /etc/s-box/sing-box
blue "成功安装 Sing-box 内核版本:$(/etc/s-box/sing-box version | awk '/version/{print $NF}')" blue "成功安装 Sing-box 内核版本:$(/etc/s-box/sing-box version | awk '/version/{print $NF}')"
sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' | cut -d '.' -f 1,2 2>/dev/null) sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' 2>/dev/null | cut -d '.' -f 1,2)
else else
red "下载 Sing-box 内核不完整,安装失败,请再运行安装一次" && exit red "下载 Sing-box 内核不完整,安装失败,请再运行安装一次" && exit
fi fi
@@ -2931,7 +2931,7 @@ readp "输入Telegram机器人用户ID: " userid
telegram_id=$userid telegram_id=$userid
echo '#!/bin/bash echo '#!/bin/bash
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' | cut -d '.' -f 1,2 2>/dev/null) sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' 2>/dev/null | cut -d '.' -f 1,2)
total_lines=$(wc -l < /etc/s-box/clmi.yaml) total_lines=$(wc -l < /etc/s-box/clmi.yaml)
half=$((total_lines / 2)) half=$((total_lines / 2))
head -n $half /etc/s-box/clmi.yaml > /etc/s-box/clash_meta_client1.txt head -n $half /etc/s-box/clmi.yaml > /etc/s-box/clash_meta_client1.txt
@@ -3860,7 +3860,7 @@ rm -rf /etc/s-box/{sing-box.tar.gz,$sbname}
if [[ -f '/etc/s-box/sing-box' ]]; then if [[ -f '/etc/s-box/sing-box' ]]; then
chown root:root /etc/s-box/sing-box chown root:root /etc/s-box/sing-box
chmod +x /etc/s-box/sing-box chmod +x /etc/s-box/sing-box
sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' | cut -d '.' -f 1,2 2>/dev/null) sbnh=$(/etc/s-box/sing-box version 2>/dev/null | awk '/version/{print $NF}' 2>/dev/null | cut -d '.' -f 1,2)
[[ "$sbnh" == "1.10" ]] && num=10 || num=11 [[ "$sbnh" == "1.10" ]] && num=10 || num=11
rm -rf /etc/s-box/sb.json rm -rf /etc/s-box/sb.json
cp /etc/s-box/sb${num}.json /etc/s-box/sb.json cp /etc/s-box/sb${num}.json /etc/s-box/sb.json