From 71c3dac63e78368cc75d5a9f5cd28af3483e3c72 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 26 May 2022 14:42:26 +0300 Subject: [PATCH] Feat(adjtimex): Rewrite `adjtimex.sh` I'm disappointed with `adjtimex --log/--review` so I do manual tweaking now. The script just synchronize system and hardware clocks. --- .../roles/adjtimex/templates/adjtimex.sh | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/playbooks/roles/adjtimex/templates/adjtimex.sh b/playbooks/roles/adjtimex/templates/adjtimex.sh index 8721907..6d97e51 100755 --- a/playbooks/roles/adjtimex/templates/adjtimex.sh +++ b/playbooks/roles/adjtimex/templates/adjtimex.sh @@ -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 -- 2.39.2