Commit 76aa606b authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-timezone: code cleanup. rename zonepath to timezone

parent 6a77f1b9
...@@ -79,10 +79,10 @@ fi ...@@ -79,10 +79,10 @@ fi
apk add --quiet $pkg apk add --quiet $pkg
if [ -L "${ROOT}"etc/zoneinfo/localtime ]; then if [ -L "${ROOT}"etc/zoneinfo/localtime ]; then
zonepath=$(readlink "${ROOT}"etc/zoneinfo/localtime) timezone=$(readlink "${ROOT}"etc/zoneinfo/localtime)
zonepath=${zonepath#*/zoneinfo/} timezone=${timezone#*/zoneinfo/}
else else
zonepath=UTC timezone=UTC
fi fi
...@@ -92,28 +92,28 @@ while true; do ...@@ -92,28 +92,28 @@ while true; do
break break
fi fi
echo -n "Which timezone are you in? ('?' for list) [$zonepath] " echo -n "Which timezone are you in? ('?' for list) [$timezone] "
default_read zonepath "$zonepath" default_read timezone "$timezone"
case "$zonepath" in case "$timezone" in
"") continue;; "") continue;;
"?") show_tz_list; continue;; "?") show_tz_list; continue;;
esac esac
while [ -d "$zroot/$zonepath" ]; do while [ -d "$zroot/$timezone" ]; do
zone= zone=
echo -n "What sub-timezone of '$zonepath' are you in? ('?' for list) " echo -n "What sub-timezone of '$timezone' are you in? ('?' for list) "
default_read zone default_read zone
case "$zone" in case "$zone" in
"?") show_tz_list "$zonepath"; continue;; "?") show_tz_list "$timezone"; continue;;
esac esac
zonepath="$zonepath/$zone" timezone="$timezone/$zone"
done done
if [ -f "$zroot/$zonepath" ]; then if [ -f "$zroot/$timezone" ]; then
setup_tz "$zroot/$zonepath" setup_tz "$zroot/$timezone"
break break
fi fi
echo "'$zonepath' is not a valid timezone on this system" echo "'$timezone' is not a valid timezone on this system"
done done
if [ -n "$apkdel" ]; then if [ -n "$apkdel" ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment