]> git.phdru.name Git - ansible.git/blobdiff - playbooks/roles/adjtimex/templates/adjtimex.sh
Feat(adjtimex): Rewrite `adjtimex.sh`
[ansible.git] / playbooks / roles / adjtimex / templates / adjtimex.sh
index 8721907b97381c5446af6d90fd64025c5cb1dfa2..6d97e51b2e38b0a45710cfdb45642c8501057578 100755 (executable)
@@ -1,8 +1,5 @@
 #! /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
@@ -13,22 +10,8 @@ host 2.debian.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