diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-03 10:58:01 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-03 11:00:14 +0000 |
commit | 576a6e772384fcc9ce73a3628ae86483567e8eb4 (patch) | |
tree | 98daded67e267df58ff29081eafa4bd94cf9a166 | |
parent | 77b181bc8f9268357ae3d2b41e10ff722d51b217 (diff) | |
download | alpine-conf-576a6e772384fcc9ce73a3628ae86483567e8eb4.zip |
setup-timezone: minor fixes
- ask for timezone after root password (before we start syslog)
- rephrase the questinos and fix input prompt to be on same line
-rw-r--r-- | setup-alpine.in | 16 | ||||
-rwxr-xr-x | setup-timezone.in | 16 |
2 files changed, 12 insertions, 20 deletions
diff --git a/setup-alpine.in b/setup-alpine.in index aeab41a..a14c1a6 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -43,6 +43,9 @@ grep '^iface.*dhcp' $ROOT/etc/network/interfaces > /dev/null ||\ # set root password [ -z "$NOCOMMIT" ] && while ! passwd ; do echo "Please retry." ; done +# pick timezone +$PREFIX/sbin/setup-timezone + rc-update -q add networking boot rc-update -q add acpid rc-update -q add cron @@ -67,16 +70,5 @@ _hn=${_hn%%.*} sed -i -e "s/^127\.0\.0\.1.*/127.0.0.1\t${_hn}.${_dn:-$(get_fqdn)} ${_hn} localhost.localdomain localhost/" /etc/hosts -printf "Setup internet apk repositories? [y/N]?" -default_read setuprepos "n" - -if [ $setuprepos == "Y" ] || [ $setuprepos == "y" ]; then - $PREFIX/sbin/setup-apkrepos -fi +$PREFIX/sbin/setup-apkrepos -printf "Change timezone (default is UTC)? [y/N]?" -default_read setuptz "n" - -if [ $setuptz == "Y" ] || [ $setuptz == "y" ]; then - $PREFIX/sbin/setup-timezone -fi diff --git a/setup-timezone.in b/setup-timezone.in index e3a8ee8..7c2283b 100755 --- a/setup-timezone.in +++ b/setup-timezone.in @@ -3,7 +3,7 @@ PREFIX= . "$PREFIX/lib/libalpine.sh" -echo "Available areas:" +echo "Available timezone areas:" echo "1) Australia" echo "2) Europe" echo "3) US & Canada" @@ -11,7 +11,7 @@ echo "4) Asia" echo "5) Central & South America" echo "6) Custom" echo "7) UTC" -echo "Choose an available area [7]:" +echo -n "What timezone are you in? [7]: " default_read areanum 7 @@ -23,7 +23,7 @@ if [ $areanum -eq 1 ]; then 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]:" + echo -n "Select a timezone [1]: " default_read timezone 1 case $timezone in 1) timezonecode="EST-10EST-11";; @@ -45,7 +45,7 @@ elif [ $areanum -eq 2 ]; then echo "6) London (GMT+0BST-1)" echo "7) Moscow (MSK-3MSD)" echo "8) St Petersburg (MST-3MDT)" - echo "Select a timezone [1]:" + echo -n "Select a timezone [1]: " default_read timezone 1 case $timezone in 1) timezonecode="CET1-CEST-2";; @@ -70,7 +70,7 @@ elif [ $areanum -eq 3 ]; then echo "8) Atlantic (AST4ADT)" echo "9) Atlantic New Brunswick (AST4ADT)" echo "10) Newfoundland (NST+3:30NDT+2:30)" - echo "Select a timezone [1]:" + echo -n "Select a timezone [1]: " default_read timezone 1 case $timezone in 1) timezonecode="HAW10";; @@ -90,7 +90,7 @@ elif [ $areanum -eq 4 ]; then echo "1) Jakarta (WIB-7)" echo "2) Singapore (SGT-8)" echo "3) Ulaanbaatar (ULAT-8ULAST)" - echo "Select a timezone [1]:" + echo -n "Select a timezone [1]: " default_read timezone 1 case $timezone in 1) timezonecode="WIB-7";; @@ -103,7 +103,7 @@ elif [ $areanum -eq 5 ]; then echo "1) Brazil (BRST+3BRDT+2)" echo "2) Argentina (UTC+3)" echo "3) Central America (CST+6)" - echo "Select a timezone [1]:" + echo -n "Select a timezone [1]: " default_read timezone 1 case $timezone in 1) timezonecode="BRST+3BRDT+2";; @@ -112,7 +112,7 @@ elif [ $areanum -eq 5 ]; then *) timezonecode="UTC";; esac elif [ $areanum -eq 6 ]; then - echo "Type in a timezone (e.g. EST-10 or CET-1CEST-2):" + echo -e "Type in a timezone (e.g. EST-10 or CET-1CEST-2):" default_read timezonecode UTC else timezonecode="UTC" |