xiaodongwang ae44332c69 update snippet to support preseed
Change-Id: I8442758ffaf3a55ec4773bf820bc4cdefb2e6452
2014-05-19 10:47:36 -07:00

19 lines
1.1 KiB
Plaintext

#if $getVar('ntp_server', '') != ""
echo "driftfile /var/lib/ntp/ntp.drift" > /target/etc/ntp.conf; \
echo "#statsdir /var/log/ntpstats/" >> /target/etc/ntp.conf; \
echo "statistics loopstats peerstats clockstats" >> /target/etc/ntp.conf; \
echo "filegen loopstats file loopstats type day enable" >> /target/etc/ntp.conf; \
echo "filegen peerstats file peerstats type day enable" >> /target/etc/ntp.conf; \
echo "filegen clockstats file clockstats type day enable" >> /target/etc/ntp.conf; \
echo "server $ntp_server" >> /target/etc/ntp.conf; \
echo "restrict -4 default kod notrap nomodify nopeer noquery" >> /target/etc/ntp.conf; \
echo "restrict -6 default kod notrap nomodify nopeer noquery" >> /target/etc/ntp.conf; \
echo "restrict 127.0.0.1" >> /target/etc/ntp.conf; \
echo "restrict ::1" >> /target/etc/ntp.conf; \
echo "server 127.127.1.0 # local clock" >> /target/etc/ntp.conf; \
chroot /target update-rc.d ntp defaults 58 74; \
chroot /target service ntp stop 2>&1 >> /tmp/ntp.log; \
chroot /target ntpdate $ntp_server 2>&1 >> /tmp/ntp.log; \
chroot /target service ntp start 2>&1 >> /tmp/ntp.log; \
#end if