fix: 换掉一开始的神人多发行版适配

by @sourcery-ai

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
This commit is contained in:
Cookie987
2025-04-02 17:09:37 +08:00
committed by GitHub
parent ea0bf051cf
commit b5e63e114e

17
run.sh
View File

@@ -216,13 +216,16 @@ run_installation() {
if ! command -v whiptail &>/dev/null; then if ! command -v whiptail &>/dev/null; then
echo -e "${RED}[1/6] whiptail 未安装,正在安装...${RESET}" echo -e "${RED}[1/6] whiptail 未安装,正在安装...${RESET}"
# 这里的多系统适配很神人,但是能用() if command -v apt-get &>/dev/null; then
apt-get update && apt-get install -y whiptail
apt update && apt install -y whiptail elif command -v pacman &>/dev/null; then
pacman -Syu --noconfirm whiptail
pacman -S --noconfirm libnewt elif command -v yum &>/dev/null; then
yum install -y whiptail
yum install -y newt else
echo -e "${RED}[Error] 无受支持的包管理器,无法安装 whiptail!${RESET}"
exit 1
fi
fi fi
# 协议确认 # 协议确认