initial commit of file from CVS for e-smith-ntp on Wed 12 Jul 09:00:21 BST 2023
This commit is contained in:
25
root/sbin/e-smith/systemd/initializedate
Normal file
25
root/sbin/e-smith/systemd/initializedate
Normal 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
|
Reference in New Issue
Block a user