Only sync ntp once per week, sync to hardware clock

This commit is contained in:
2024-01-10 15:22:08 -05:00
parent 60d94900d7
commit 0b4ba9560a
3 changed files with 10 additions and 3 deletions
+1 -2
View File
@@ -20,8 +20,7 @@ echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
ln -s /usr/share/zoneinfo/"$timezone" /etc/localtime
locale-gen
hwclock --systohc --utc
echo -e "#!/bin/sh\nntpdate -b pool.ntp.org &" > /etc/local.d/ntp.start
curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/programs/ntp-rclocal/ntp.start -o /etc/local.d/ntp.start
chmod 755 /etc/local.d/ntp.start
# networkmanager configuration
+1 -1
View File
@@ -3,7 +3,7 @@
loadkeys us
echo ----------------------------------------------------------------------------------------------
echo rwinkhart\'s artix install script
echo last updated december 28, 2023 \(rev. A\)
echo last updated january 10, 2024 \(rev. A\)
echo ----------------------------------------------------------------------------------------------
echo You will be asked some questions before installation.
echo -e "----------------------------------------------------------------------------------------------\n"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
old_timestamp="$(</etc/local.d/.ntpsync)"
new_timestamp="$(date +%s)"
if [ "$((new_timestamp-old_timestamp))" -gt 604800 ]; then
ntpdate -b pool.ntp.org
hwclock --systohc --utc
echo "$new_timestamp" > /etc/local.d/.ntpsync
fi