Move showQuestions to lib.sh

This commit is contained in:
Rezart Qelibari
2022-02-17 12:47:32 +01:00
parent 0f6313e777
commit 14f2107edf
2 changed files with 10 additions and 5 deletions

View File

@@ -16,16 +16,13 @@ function checkPrerequisites() {
checkCommands checkCommands
} }
function showQuestions() { function getQuestions() {
local timezones questions question local timezones
timezones="`systemsetup -listtimezones | tail -n +2 | awk '{print $1}' | paste -sd, -`" timezones="`systemsetup -listtimezones | tail -n +2 | awk '{print $1}' | paste -sd, -`"
questions=( questions=(
'i: hostname=What shall the hostname of this host be?' 'i: hostname=What shall the hostname of this host be?'
's: timezone=What shall the timezone of this host be? # choose from:'"${timezones};" 's: timezone=What shall the timezone of this host be? # choose from:'"${timezones};"
) )
for question in ${questions}; do
hio info "${question}"
done
} }
function quitSystemPreferences() { function quitSystemPreferences() {

View File

@@ -26,6 +26,14 @@ function checkCommands() {
done done
} }
function showQuestions() {
local questions=()
getQuestions
for question in ${questions}; do
hio info "${question}"
done
}
function module_main() { function module_main() {
autoloadZShLib || return autoloadZShLib || return
checkPrerequisites || return checkPrerequisites || return