17
12
start-stop-daemon --stop --quiet --exec /usr/sbin/ntpd
19
. /usr/share/debconf/confmodule
21
db_get shared/ntp/update-conf
22
OverwriteConfig="${RET:-true}"
24
# only emit config files if the admin gave us permission to do so
25
if test "$OverwriteConfig" = "true"
28
# get list of servers from debconf and write shared info file
29
db_get shared/ntp/servers
30
echo "NTPSERVERS=\"$RET\"" > $NS
32
# if no ntp.conf file exists or it's empty, stuff a template
36
echo "# /etc/ntp.conf, configuration for ntpd" > $NC
38
echo "# ntpd will use syslog() if logfile is not defined" >> $NC
39
echo "#logfile /var/log/ntpd" >> $NC
41
echo "driftfile /var/lib/ntp/ntp.drift" >> $NC
42
echo "statsdir /var/log/ntpstats/" >> $NC
44
echo "statistics loopstats peerstats clockstats" >> $NC
45
echo "filegen loopstats file loopstats type day enable" >> $NC
46
echo "filegen peerstats file peerstats type day enable" >> $NC
47
echo "filegen clockstats file clockstats type day enable" >> $NC
49
echo "### lines starting 'server' are auto generated," >> $NC
50
echo "### use dpkg-reconfigure to modify those lines." >> $NC
54
# since ntpd does not support an include file mechanism for ntp.conf,
55
# we have to rewrite it every time the list of servers changes.
56
# to allow the most system admin flexibility regarding other options,
57
# we will leave everything alone except lines starting with 'server',
58
# and replace those with fresh lines at the end of the file derived
61
grep -v "^server" $NC > $NC.new
63
db_get shared/ntp/servers
66
echo "server $i" >> $NC.new
72
# all done with debconf here.