- add support for multiple coma separated NTPServer [SME: 10623] - fix ntpd ong to start if not ntp server set [SME: 12954]
14 lines
357 B
Bash
14 lines
357 B
Bash
#!/bin/bash
|
|
NEWFILE='/var/lib/ntp/drift'
|
|
if [ -f "$NEWFILE" ]; then
|
|
/usr/bin/chown ntp:ntp $NEWFILE
|
|
fi
|
|
|
|
#exit if setting to only use hardware clock
|
|
grep '^# sync to hw clock$' /etc/ntp.conf && exit 0
|
|
# force sync date and time
|
|
/usr/sbin/ntpd -q -x -g -g -g -g >/dev/null
|
|
# set hardware clock to the current time
|
|
/usr/sbin/hwclock --systohc
|
|
exit 0
|