Fixed up the timezone code so that it uses existing functions.
This commit is contained in:
parent
87c79b59c9
commit
669c4d4009
@ -153,20 +153,9 @@ fi
|
|||||||
if [[ "$answer" == "No" ]]; then
|
if [[ "$answer" == "No" ]]; then
|
||||||
# Get the list of timezones
|
# Get the list of timezones
|
||||||
mapfile -t regions < <(timedatectl --no-pager list-timezones | cut -d '/' -f1 | sort -u)
|
mapfile -t regions < <(timedatectl --no-pager list-timezones | cut -d '/' -f1 | sort -u)
|
||||||
|
region=$(menulist ${regions[@]})
|
||||||
# Use the same text twice here and just hide the tag field.
|
|
||||||
region=$(dialog --backtitle "$(gettext "Please select your Region")" \
|
|
||||||
--no-tags \
|
|
||||||
--menu "$(gettext "Use up and down arrows or page-up and page-down to navigate the list, and press 'Enter' to make your selection.")" 0 0 0 \
|
|
||||||
$(for i in ${regions[@]} ; do echo "$i";echo "$(gettext "$i")";done) --stdout)
|
|
||||||
|
|
||||||
mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u)
|
mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u)
|
||||||
|
city=$(menulist ${cities[@]})
|
||||||
# Use the same text twice here and just hide the tag field.
|
|
||||||
city=$(dialog --backtitle "$(gettext "Please select a city near you")" \
|
|
||||||
--no-tags \
|
|
||||||
--menu "$(gettext "Use up and down arrow or page-up and page-down to navigate the list.")" 0 0 10 \
|
|
||||||
$(for i in ${cities[@]} ; do echo "$i";echo "$(gettext "$i")";done) --stdout)
|
|
||||||
|
|
||||||
timezone="${region}/${city}"
|
timezone="${region}/${city}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user