mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
always use ntp
This commit is contained in:
parent
cc9d9cb4e9
commit
e38f97e91b
1 changed files with 9 additions and 12 deletions
|
@ -49,18 +49,15 @@ _timeset() {
|
||||||
_hwclock
|
_hwclock
|
||||||
# check internet connection
|
# check internet connection
|
||||||
if ping -c1 www.google.com &>/dev/null; then
|
if ping -c1 www.google.com &>/dev/null; then
|
||||||
if _dialog --yesno \
|
_dialog --infobox "Syncing clock with NTP pool..." 3 45
|
||||||
"Do you want to use the Network Time Protocol (NTP) for syncing your clock, by using the internet clock pool?" 6 60; then
|
# sync immediatly with standard pool
|
||||||
_dialog --infobox "Syncing clock with NTP pool..." 3 45
|
if ! systemctl restart systemd-timesyncd; then
|
||||||
# sync immediatly with standard pool
|
_dialog --msgbox "An error has occured, time was not changed!" 0 0
|
||||||
if ! systemctl restart systemd-timesyncd; then
|
_SET_TIME=""
|
||||||
_dialog --msgbox "An error has occured, time was not changed!" 0 0
|
else
|
||||||
_SET_TIME=""
|
# enable background syncing
|
||||||
else
|
timedatectl set-ntp 1
|
||||||
# enable background syncing
|
_SET_TIME="1"
|
||||||
timedatectl set-ntp 1
|
|
||||||
_SET_TIME="1"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -z "${_SET_TIME}" ]]; then
|
if [[ -z "${_SET_TIME}" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue