initial commit of file from CVS for e-smith-ntp on Wed 12 Jul 09:00:21 BST 2023

This commit is contained in:
Brian Read
2023-07-12 09:00:21 +01:00
parent 59f5643b62
commit 4d143a42fe
37 changed files with 3230 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/bash
#first move old drift file if in the way
OLDFILE='/etc/ntp/drift'
NEWFILE='/var/lib/ntp/drift'
if [ -f "$NEWFILE" ]; then
if [ -f "$OLDFILE" ];then
/usr/bin/rm -f $OLDFILE
fi
else
if [ -f "$OLDFILE" ];then
/usr/bin/mv $OLDFILE $NEWFILE
fi
fi
if [ -f "$NEWFILE" ]; then
/usr/bin/chown ntp:ntp $NEWFILE
fi
# Run ntpdate so we're not way off on startup.
ntpstep=/etc/ntp/step-tickers
tickers=`/bin/sed -e 's/\#.*$//g' $ntpstep`
#get current date (will need to update this command soon to be retired : ntpd -q -x -g -g -g -g
/usr/sbin/ntpdate -b -p 8 $tickers
# set hardware clock to the current time
/usr/sbin/hwclock --systohc
exit 0