#!/usr/bin/env bash export DIALOGOPTS='--insecure --no-lines --visit-items' inputbox() { local promptText="$1" local initialValue="${2:-}" dialog --backtitle "Configure Server" \ --clear \ --inputbox "$promptText" 0 0 "$initialValue" --stdout } passwordbox() { local promptText="$1" local initialValue="${2:-}" dialog --backtitle "Configure Server" \ --clear \ --passwordbox "$promptText" 0 0 "$initialValue" --stdout } msgbox() { dialog --backtitle "Configure Server" \ --clear \ --msgbox "$*" 10 72 } yesno() { if dialog --backtitle "Configure Server" \ --clear \ --yesno "$*" 10 80 --stdout; then echo "Yes" else echo "No" fi } menulist() { local menuList=() local menuItem="" for menuItem in "$@"; do menuList+=("$menuItem" "$menuItem") done dialog --backtitle "Configure Server" \ --clear \ --no-tags \ --menu "Please select an option" 0 0 0 "${menuList[@]}" --stdout } textbox() { local filePath="$1" dialog --backtitle "Configure Server" \ --clear \ --textbox "$filePath" 0 0 }