5
source=`config-get source`
7
if [[ -n "$source" && $source != 'LOCAL' ]]
9
cat > /etc/ntp.conf << EOF
10
# juju generate ntp configuration
11
driftfile /var/lib/ntp/ntp.drift
12
statistics loopstats peerstats clockstats
13
filegen loopstats file loopstats type day enable
14
filegen peerstats file peerstats type day enable
15
filegen clockstats file clockstats type day enable
16
restrict -4 default kod notrap nomodify nopeer noquery
17
restrict -6 default kod notrap nomodify nopeer noquery
23
echo "server $host iburst" >> /etc/ntp.conf
25
elif [[ -n "$source" && $source == 'LOCAL' ]]
27
echo "THIS IS GOING TO BE A LOCAL SERVER"
28
echo "Let s pretent the local clock is stratum 5"
29
cat > /etc/ntp.conf << EOF
30
# juju generate ntp configuration
31
driftfile /var/lib/ntp/ntp.drift
32
statistics loopstats peerstats clockstats
33
filegen loopstats file loopstats type day enable
34
filegen peerstats file peerstats type day enable
35
filegen clockstats file clockstats type day enable
36
restrict -4 default kod notrap nomodify nopeer noquery
37
restrict -6 default kod notrap nomodify nopeer noquery
40
fudge 127.127.1.0 stratum 5
44
# Restore backup of installed file
45
cp /etc/ntp.conf.orig /etc/ntp.conf
48
service ntp restart || true