Files
ZFSBootMenu-Root-Install/menu.sh

59 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
option='start'
while [[ ! "${option}" == 'Exit' ]]; do
printf '\033[?47h\033[2J\033[H'
cat << EOF
#######################################
## ##
## $(cat "${baseDir}/title") Script ##
## ##
## Jean <jean@easthighnerd.net> ##
## ##
#######################################
#################
## ##
## Main Menu ##
## ##
#################
EOF
select option in 'List' 'Configure' 'Install' 'Finalize' 'WiFi Setup' 'Exit'
do
case "${option}" in
'List'|'Configure'|'Install'|'Finalize'|'WiFi Setup'|'Exit')
break
;;
*)
printf 'Invalid option\n'
;;
esac
done
printf '\033[2J\033[H'
if [[ "${option}" == 'List' ]]; then
"${baseDir}/list.sh"
elif [[ "${option}" == 'Configure' ]]; then
"${baseDir}/configure.sh"
elif [[ "${option}" == 'Install' ]]; then
"${baseDir}/pre-inst.sh"
elif [[ "${option}" == 'Finalize' ]]; then
"${baseDir}/finalize.sh"
elif [[ "${option}" == 'WiFi Setup' ]]; then
"${baseDir}/wifi.sh"
fi
printf '\033[?47h\033[2J\033[H'
done
printf '\033[?47l'