v3.3.2: 启动时自动检测并安装依赖

This commit is contained in:
mango
2026-02-02 11:17:53 +08:00
parent 273a022463
commit 80a3e919ac

View File

@@ -51,6 +51,18 @@ install_deps() {
esac
}
check_deps() {
local missing=""
command -v rsync &>/dev/null || missing+=" rsync"
command -v sshpass &>/dev/null || missing+=" sshpass"
command -v jq &>/dev/null || missing+=" jq"
if [ -n "$missing" ]; then
warn "缺少依赖:$missing,正在安装..."
install_deps
fi
}
#===============================================================================
# 智能识别应用
#===============================================================================
@@ -737,6 +749,9 @@ do_setup() {
#===============================================================================
show_menu() {
# 自动检测并安装依赖
check_deps
print_banner
load_config 2>/dev/null || true