fix: install whiptail if not present for interactive prompts in setup script
This commit is contained in:
@ -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")
|
||||
|
||||
Reference in New Issue
Block a user