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

by @sourcery-ai

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
pull/637/head
Cookie987 2025-04-02 17:09:37 +08:00 committed by GitHub
parent ea0bf051cf
commit b5e63e114e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 7 deletions

17
run.sh
View File

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