summaryrefslogtreecommitdiff
path: root/setup-timezone.in
diff options
context:
space:
mode:
authorJeff Bilyk <jbilyk@gmail.com>2011-02-26 22:59:14 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2011-02-26 23:05:34 -0600
commit8a330b843f257e0694c291785e447371a59ff314 (patch)
tree0b8cdeed58acb47b78d2acd31d7cbeb9591ced92 /setup-timezone.in
parentf7b18f26778cf51dccea661a545fa4add662e7ae (diff)
downloadalpine-conf-8a330b843f257e0694c291785e447371a59ff314.zip
setup-timezone: initial version of script
initial cut at a setup-timezone script
Diffstat (limited to 'setup-timezone.in')
-rwxr-xr-xsetup-timezone.in122
1 files changed, 122 insertions, 0 deletions
diff --git a/setup-timezone.in b/setup-timezone.in
new file mode 100755
index 0000000..e3a8ee8
--- /dev/null
+++ b/setup-timezone.in
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+PREFIX=
+. "$PREFIX/lib/libalpine.sh"
+
+echo "Available areas:"
+echo "1) Australia"
+echo "2) Europe"
+echo "3) US & Canada"
+echo "4) Asia"
+echo "5) Central & South America"
+echo "6) Custom"
+echo "7) UTC"
+echo "Choose an available area [7]:"
+
+default_read areanum 7
+
+if [ $areanum -eq 1 ]; then
+ echo "Available Timezones:"
+ echo "1) Melbourne, Canberra, Sydney (EST-10EST-11)"
+ echo "2) Perth (WST-8)"
+ echo "3) Brisbane (EST-10)"
+ echo "4) Adelaide (CST-9:30CDT-10:30)"
+ echo "5) Darwin (CST-9:30)"
+ echo "6) Hobart (EST-10EDT-11)"
+ echo "Select a timezone [1]:"
+ default_read timezone 1
+ case $timezone in
+ 1) timezonecode="EST-10EST-11";;
+ 2) timezonecode="WST-8";;
+ 3) timezonecode="EST-10";;
+ 4) timezonecode="CST-9:30CDT-10:30";;
+ 5) timezonecode="CST-9:30";;
+ 6) timezonecode="EST-10EDT-11";;
+ *) timezonecode="UTC";;
+ esac
+
+elif [ $areanum -eq 2 ]; then
+ echo "Available Timezones:"
+ echo "1) Amsterdam, Barcelona, Berlin, Brussels, Budapest, Copenhagen, Geneva, Madrid, Oslo, Paris, Prague, Rome, or Stockholm (CET1-CEST-2)"
+ echo "2) Athens, Helsinki, Tallinn (EET-2EEST-3)"
+ echo "3) Dublin (GMT+0IST-1)"
+ echo "4) Kyiv (EET-2EEST)"
+ echo "5) Lisbon (WET-0WEST-1)"
+ echo "6) London (GMT+0BST-1)"
+ echo "7) Moscow (MSK-3MSD)"
+ echo "8) St Petersburg (MST-3MDT)"
+ echo "Select a timezone [1]:"
+ default_read timezone 1
+ case $timezone in
+ 1) timezonecode="CET1-CEST-2";;
+ 2) timezonecode="EET-2EEST-3";;
+ 3) timezonecode="GMT+0IST-1";;
+ 4) timezonecode="EET-2EEST";;
+ 5) timezonecode="WET-0WEST-1";;
+ 6) timezonecode="GMT+0BST-1";;
+ 7) timezonecode="MSK-3MSD";;
+ 8) timezonecode="MST-3MDT";;
+ *) timezonecode="UTC";;
+ esac
+elif [ $areanum -eq 3 ]; then
+ echo "Available Timezones:"
+ echo "1) Hawaii (HAW10)"
+ echo "2) Alaska (AKST9AKDT)"
+ echo "3) Pacific (PST8PDT)"
+ echo "4) Mountain (MST7MDT)"
+ echo "5) Mountain - Arizona (MST7)"
+ echo "6) Central (CST6CDT)"
+ echo "7) Eastern (EST5EDT)"
+ echo "8) Atlantic (AST4ADT)"
+ echo "9) Atlantic New Brunswick (AST4ADT)"
+ echo "10) Newfoundland (NST+3:30NDT+2:30)"
+ echo "Select a timezone [1]:"
+ default_read timezone 1
+ case $timezone in
+ 1) timezonecode="HAW10";;
+ 2) timezonecode="AKST9AKDT";;
+ 3) timezonecode="PST8PDT";;
+ 4) timezonecode="MST7MDT";;
+ 5) timezonecode="MST7";;
+ 6) timezonecode="CST6CDT";;
+ 7) timezonecode="EST5EDT";;
+ 8) timezonecode="AST4ADT";;
+ 9) timezonecode="AST4ADT";;
+ 10) timezonecode="NST+3:30NDT+2:30";;
+ *) timezonecode="UTC";;
+ esac
+elif [ $areanum -eq 4 ]; then
+ echo "Available Timezones:"
+ echo "1) Jakarta (WIB-7)"
+ echo "2) Singapore (SGT-8)"
+ echo "3) Ulaanbaatar (ULAT-8ULAST)"
+ echo "Select a timezone [1]:"
+ default_read timezone 1
+ case $timezone in
+ 1) timezonecode="WIB-7";;
+ 2) timezonecode="SGT-8)";;
+ 3) timezonecode="ULAT-8ULAST)";;
+ *) timezonecode="UTC";;
+ esac
+elif [ $areanum -eq 5 ]; then
+ echo "Available Timezones:"
+ echo "1) Brazil (BRST+3BRDT+2)"
+ echo "2) Argentina (UTC+3)"
+ echo "3) Central America (CST+6)"
+ echo "Select a timezone [1]:"
+ default_read timezone 1
+ case $timezone in
+ 1) timezonecode="BRST+3BRDT+2";;
+ 2) timezonecode="UTC+3";;
+ 3) timezonecode="CST+6";;
+ *) timezonecode="UTC";;
+ esac
+elif [ $areanum -eq 6 ]; then
+ echo "Type in a timezone (e.g. EST-10 or CET-1CEST-2):"
+ default_read timezonecode UTC
+else
+ timezonecode="UTC"
+fi
+echo "Timezone: $timezonecode"
+echo "$timezonecode" > /etc/TZ
+