MycroftOS: More timesync changes.

This commit is contained in:
j1nx 2020-07-21 08:18:22 +02:00
parent b978459f29
commit 6b92a68a3e
4 changed files with 29 additions and 6 deletions

View File

@ -0,0 +1,6 @@
#!/bin/sh
case "$2" in
up)
timedatectl set-timezone "$(curl --fail https://ipapi.co/timezone)"
;;
esac

View File

@ -0,0 +1,20 @@
#! /usr/bin/bash
[ -n "$CONNECTION_UUID" ] || exit
INTERFACE=$1
ACTION=$2
case $ACTION in
up | dhcp4-change | dhcp6-change)
[ -n "$DHCP4_NTP_SERVERS" ] || exit
exec > /etc/systemd/timesyncd.conf.d/$CONNECTION_UUID.conf
echo "[Time]"
echo "NTP=$DHCP4_NTP_SERVERS"
systemctl restart systemd-timesyncd
;;
down)
rm -f /etc/systemd/timesyncd.conf.d/$CONNECTION_UUID.conf
systemctl restart systemd-timesyncd
;;
esac

View File

@ -1,6 +0,0 @@
[Match]
Name=eth0
[Network]
DHCP=ipv4
[DHCP]
RouteMetric=10

View File

@ -0,0 +1,3 @@
[Time]
NTP=time.cloudflare.com
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org