#! /bin/sh
-# Stole some ideas from
-# http://support.ntp.org/bin/view/Support/ManualCalibration
-
# Warm up DNS
host -t ns pool.ntp.org
host pool.ntp.org
host 3.debian.pool.ntp.org
{% endif %}
-{ echo; echo; } | adjtimex -l &&
-ntpdate{% if ansible_facts.os_family == 'Debian' %}-debian{% endif %} &&
-{ echo; echo; } | adjtimex -l &&
-
+ntpdate{% if ansible_facts.os_family == 'Debian' %}-debian{% endif %} -b &&
hwclock --systohc --update-drift &&
-{ echo; echo; } | adjtimex -l &&
-hwclock --hctosys &&
-
-{ echo; echo; } | adjtimex -l &&
-adjtimex -r --adjust &&
-{ echo; echo; } | adjtimex -l &&
-
-freq=`adjtimex -p | awk '/frequency:/ {print $2}'` &&
-tick=`adjtimex -p | awk '/tick:/ {print $2}'` &&
-#adjtimex -f "$freq" -t "$tick" &&
-tail -2 /etc/default/adjtimex &&
-sed -i -e "s/^FREQ=.\+$/FREQ=$freq/" -e "s/^TICK=.\+$/TICK=$tick/" /etc/default/adjtimex &&
-exec tail -2 /etc/default/adjtimex
+hwclock --get &&
+exec date