tzupdate may be available but without internet
This commit is contained in:
1 parent
acc5e0b274
commit
ebe7ab1f51
1 file changed
+5
-1
@@ -95,6 +95,11 @@ user_form() {
|
|||||||
# Pick timezone
|
# Pick timezone
|
||||||
if command -v tzupdate >/dev/null; then
|
if command -v tzupdate >/dev/null; then
|
||||||
geo_guessed_timezone=$(tzupdate -p 2>/dev/null)
|
geo_guessed_timezone=$(tzupdate -p 2>/dev/null)
|
||||||
|
else
|
||||||
|
geo_guessed_timezone=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $geo_guessed_timezone ]]; then
|
||||||
timezone=$(timedatectl list-timezones | gum choose --height 10 --selected "$geo_guessed_timezone" --header "Timezone") || abort
|
timezone=$(timedatectl list-timezones | gum choose --height 10 --selected "$geo_guessed_timezone" --header "Timezone") || abort
|
||||||
else
|
else
|
||||||
timezone=$(timedatectl list-timezones | gum filter --height 10 --header "Timezone") || abort
|
timezone=$(timedatectl list-timezones | gum filter --height 10 --header "Timezone") || abort
|
||||||
@@ -361,4 +366,3 @@ if [[ $1 == "dry" ]]; then
|
|||||||
|
|
||||||
rm user_configuration.json user_credentials.json user_full_name.txt user_email_address.txt
|
rm user_configuration.json user_credentials.json user_full_name.txt user_email_address.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Reference in new issue
Block a user