mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-30 14:46:31 +00:00
S50date: use ntpd -gq instead of ntpdate
This commit is contained in:
parent
0174585166
commit
bbc21276af
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
PROG_DATE="/bin/date"
|
PROG_DATE="/bin/date"
|
||||||
PROG_NTPD="/usr/sbin/ntpd"
|
PROG_NTPD="/usr/sbin/ntpd"
|
||||||
PROG_NTPDATE="/usr/bin/ntpdate"
|
|
||||||
|
|
||||||
SYS_CONF="/etc/date.conf"
|
SYS_CONF="/etc/date.conf"
|
||||||
BOOT_CONF="/boot/date.conf"
|
BOOT_CONF="/boot/date.conf"
|
||||||
@ -46,7 +45,7 @@ set_current_date_http() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_current_date_ntp() {
|
set_current_date_ntp() {
|
||||||
cat ${NTP_CONF} | grep server | head -n 1 | cut -d ' ' -f 2 | xargs ${PROG_NTPDATE} -t ${DATE_TIMEOUT} -s
|
${PROG_NTPD} -gq &>/dev/null
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
logger -t date "current system date/time set to $(date) via NTP"
|
logger -t date "current system date/time set to $(date) via NTP"
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user