smeserver-ntp/root/sbin/e-smith/systemd/initializedate

12 lines
259 B
Plaintext
Raw Normal View History

#!/bin/bash
NEWFILE='/var/lib/ntp/drift'
if [ -f "$NEWFILE" ]; then
/usr/bin/chown ntp:ntp $NEWFILE
fi
# 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