summaryrefslogtreecommitdiff
path: root/setup-timezone.in
blob: e3a8ee8e924f20167b566fc73e850cb195085189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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