diff --git a/modules/01-system-settings.sh b/modules/01-system-settings.sh index d597826..f7415ed 100755 --- a/modules/01-system-settings.sh +++ b/modules/01-system-settings.sh @@ -16,16 +16,13 @@ function checkPrerequisites() { checkCommands } -function showQuestions() { - local timezones questions question +function getQuestions() { + local timezones timezones="`systemsetup -listtimezones | tail -n +2 | awk '{print $1}' | paste -sd, -`" questions=( 'i: hostname=What shall the hostname of this host be?' 's: timezone=What shall the timezone of this host be? # choose from:'"${timezones};" ) - for question in ${questions}; do - hio info "${question}" - done } function quitSystemPreferences() { diff --git a/modules/lib.sh b/modules/lib.sh index 1afb518..ce46350 100644 --- a/modules/lib.sh +++ b/modules/lib.sh @@ -26,6 +26,14 @@ function checkCommands() { done } +function showQuestions() { + local questions=() + getQuestions + for question in ${questions}; do + hio info "${question}" + done +} + function module_main() { autoloadZShLib || return checkPrerequisites || return