~优化dns菜单,移除fake-ip模式,并将部分原进阶选项移动至dns主菜单

~优化tg-bot绑定流程,增加循环检测对话ID机制
~优化tg-bot启动逻辑,现在不会随着内核服务重启而重启进而导致死循环
~优化公网防火墙功能,增加一键清空功能,增加vmess和ss端口的额外显示
~优化vmess和ss的界面逻辑,增加vmess一键生成时的混淆host输入
~修复因为未选择ss加密类型而导致启动失败的bug
~修复小米/网件镜像化设备重启后服务丢失的bug
~修复因为切换vmess和ss端口导致公网防火墙启动报错的bug
~修复6-5设置定时任务报错的bug
This commit is contained in:
juewuy
2025-12-28 21:15:34 +08:00
parent ad19f96138
commit c9cb6d41ac
20 changed files with 127 additions and 129 deletions

View File

@@ -22,14 +22,26 @@ tg_push_token(){
setconfig chat_ID "$chat_ID"
"$CRASHDIR"/start.sh logger "已完成Telegram日志推送设置" 32
}
get_chatid(){
i=1
chat_ID=''
while [ $i -le 3 ] && [ -z "$chat_ID" ]; do
sleep 1
echo -e "\033[33m第 $i 次尝试获取对话ID失败正在重试...\033[0m"
chat=$(web_get_lite "$url_tg" 2>/dev/null)
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//')
fi
i=$((i + 1))
done
}
set_bot() {
public_key=$(cat /proc/sys/kernel/random/boot_id | sed 's/.*-//')
echo -e "发送此秘钥: \033[30;46m$public_key\033[0m"
echo "-----------------------------------------------"
read -p "我已经发送完成(1/0) > " res
if [ "$res" = 1 ]; then
chat=$(web_get_lite $url_tg 2>/dev/null)
[ -n "$chat" ] && 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//')
get_chatid
[ -z "$chat_ID" ] && [ "$TOKEN" != 'publictoken' ] && {
echo -e "\033[31m无法获取对话ID请返回重新设置或手动输入ChatID\033[0m"
echo -e "通常访问 \033[32;4m$url_tg\033[0m \n\033[36m即可看到ChatID\033[0m"