Number contents of /etc/local.d

This commit is contained in:
2024-02-16 18:53:13 -05:00
parent e8c7569fde
commit d69c30ce72
5 changed files with 10 additions and 10 deletions
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
old_timestamp="$(cat /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