From 669c4d40091a74870e45de84161f2a134d5ca130 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 9 Jun 2020 23:46:41 -0400 Subject: [PATCH] Fixed up the timezone code so that it uses existing functions. --- configure-stormux.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/configure-stormux.sh b/configure-stormux.sh index 9db0f8d..f3a8875 100755 --- a/configure-stormux.sh +++ b/configure-stormux.sh @@ -153,20 +153,9 @@ fi if [[ "$answer" == "No" ]]; then # Get the list of timezones mapfile -t regions < <(timedatectl --no-pager list-timezones | cut -d '/' -f1 | sort -u) - -# 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) - +region=$(menulist ${regions[@]}) mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u) - -# 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) +city=$(menulist ${cities[@]}) timezone="${region}/${city}" fi