fix: install whiptail if not present for interactive prompts in setup script

This commit is contained in:
Timothy Hofland
2026-03-15 17:13:05 +01:00
parent 82813baa58
commit 2a4a3a15ac

View File

@ -24,6 +24,17 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi
# Ensure interactive prompt tooling is available
if ! command -v whiptail > /dev/null 2>&1; then
echo "Installing whiptail for interactive prompts..."
if command -v apt-get > /dev/null 2>&1; then
apt-get update -y
DEBIAN_FRONTEND=noninteractive apt-get install -y whiptail
elif command -v pacman > /dev/null 2>&1; then
pacman -S --noconfirm whiptail
fi
fi
# Detect user
REAL_USER=${SUDO_USER:-$(logname)}
REAL_HOME=$(eval echo "~$REAL_USER")