#!/bin/bash set -euo pipefail BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")" OPTION='start' while [[ ! "${OPTION}" == 'Exit' ]]; do printf '\033[?47h\033[2J\033[H' cat << EOF ####################################### ## ## ## $(cat "${BASEDIR}/title") Script ## ## ## ## Jean ## ## ## ####################################### ################# ## ## ## Main Menu ## ## ## ################# EOF select OPTION in 'List' 'Configure' 'Partition' 'Install' 'WiFi Setup' 'Post Install' 'Finalize' 'Exit' do case "${OPTION}" in 'List'|'Configure'|'Partition'|'Install'|'WiFi Setup'|'Post Install'|'Finalize'|'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}" == 'Partition' ]]; then "${BASEDIR}/partition.sh" elif [[ "${OPTION}" == 'Install' ]]; then "${BASEDIR}/install.sh" elif [[ "${OPTION}" == 'WiFi Setup' ]]; then "${BASEDIR}/wifi.sh" elif [[ "${OPTION}" == 'Post Install' ]]; then "${BASEDIR}/post-inst.sh" elif [[ "${OPTION}" == 'Finalize' ]]; then "${BASEDIR}/finalize.sh" fi printf '\033[?47h\033[2J\033[H' done printf '\033[?47l'