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

setup-timezone: code cleanup. rename zonepath to timezone

parent 6a77f1b9
......@@ -79,10 +79,10 @@ fi
apk add --quiet $pkg
if [ -L "${ROOT}"etc/zoneinfo/localtime ]; then
zonepath=$(readlink "${ROOT}"etc/zoneinfo/localtime)
zonepath=${zonepath#*/zoneinfo/}
timezone=$(readlink "${ROOT}"etc/zoneinfo/localtime)
timezone=${timezone#*/zoneinfo/}
else
zonepath=UTC
timezone=UTC
fi
......@@ -92,28 +92,28 @@ while true; do
break
fi
echo -n "Which timezone are you in? ('?' for list) [$zonepath] "
default_read zonepath "$zonepath"
case "$zonepath" in
echo -n "Which timezone are you in? ('?' for list) [$timezone] "
default_read timezone "$timezone"
case "$timezone" in
"") continue;;
"?") show_tz_list; continue;;
esac
while [ -d "$zroot/$zonepath" ]; do
while [ -d "$zroot/$timezone" ]; do
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
case "$zone" in
"?") show_tz_list "$zonepath"; continue;;
"?") show_tz_list "$timezone"; continue;;
esac
zonepath="$zonepath/$zone"
timezone="$timezone/$zone"
done
if [ -f "$zroot/$zonepath" ]; then
setup_tz "$zroot/$zonepath"
if [ -f "$zroot/$timezone" ]; then
setup_tz "$zroot/$timezone"
break
fi
echo "'$zonepath' is not a valid timezone on this system"
echo "'$timezone' is not a valid timezone on this system"
done
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