fix tz for correct output

This commit is contained in:
Tobias Powalowski 2013-06-03 16:24:12 +02:00
parent a1e7dec006
commit c3fcabc8ce

View file

@ -43,12 +43,12 @@ if [[ ! -f /etc/adjtime ]]; then
fi
if [[ "${HARDWARECLOCK}" = "UTC" ]]; then
timedatectl set-local-rtc 0
DATE_PROGRAM=$(timedatectl)
DATE_PROGRAM=timedatectl
# for setup script
echo UTC > /tmp/.hardwareclock
else
timedatectl set-local-rtc 1
DATE_PROGRAM=$(date)
DATE_PROGRAM=date
# for setup script
echo LOCAL > /tmp/.hardwareclock
fi
@ -87,7 +87,7 @@ if [[ ! -s /tmp/.timezone ]]; then
fi
DIALOG --yesno "Do you want to use UTC for your clock?\n\nIf you choose 'YES' UTC (recommended default) is used,\nwhich ensures daylightsaving is set automatically.\n\nIf you choose 'NO' Localtime is used, which means\nthe system will not change the time automatically.\nLocaltime is also prefered on dualboot machines,\nwhich also run Windows, because UTC confuses it." 15 65 && HARDWARECLOCK="UTC"
dohwclock
DIALOG --cr-wrap --yesno "Your current time and date is:\n${DATE_PROGRAM}\n\nDo you want to change it?" 0 0 && SET_TIME="1"
DIALOG --cr-wrap --yesno "Your current time and date is:\n$(${DATE_PROGRAM})\n\nDo you want to change it?" 0 0 && SET_TIME="1"
if [[ "${SET_TIME}" = "1" ]]; then
timedatectl set-ntp 0
[[ $(which ntpd) ]] && DIALOG --defaultno --yesno "'ntpd' was detected on your system.\n\nDo you want to use 'ntpd' for syncing your clock,\nby using the internet clock pool?\n(You need a working internet connection for doing this!)" 0 0 && USE_NTPD="1"
@ -100,7 +100,7 @@ if [[ "${SET_TIME}" = "1" ]]; then
fi
# enable background syncing
timedatectl set-ntp 1
DIALOG --cr-wrap --msgbox "Synced clock with internet pool successfully.\n\nYour current time is now:\n${DATE_PROGRAM}" 0 0
DIALOG --cr-wrap --msgbox "Synced clock with internet pool successfully.\n\nYour current time is now:\n$(${DATE_PROGRAM})" 0 0
else
# display and ask to set date/time
CANCEL=""
@ -120,7 +120,7 @@ if [[ "${SET_TIME}" = "1" ]]; then
# DD/MM/YYYY hh:mm:ss -> YYYY-MM-DD hh:mm:ss
local _datetime="$(echo "${_date}" "${_time}" | sed 's#\(..\)/\(..\)/\(....\) \(..\):\(..\):\(..\)#\3-\2-\1 \4:\5:\6#g')"
timedatectl set-time "${_datetime}"
DIALOG --cr-wrap --msgbox "Your current time is now:\n${DATE_PROGRAM}" 0 0
DIALOG --cr-wrap --msgbox "Your current time is now:\n$(${DATE_PROGRAM})" 0 0
fi
fi
S_NEXTITEM="3"