mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-03-02 10:37:51 +01:00
Sync the clock and check connectivity faster
This commit is contained in:
parent
033eebedd1
commit
44b7c78705
@ -9,3 +9,14 @@ unmanaged-devices=type:bridge;type:tun;type:veth
|
||||
|
||||
[logging]
|
||||
backend=journal
|
||||
|
||||
[connection]
|
||||
connection.mdns=2
|
||||
connection.llmnr=2
|
||||
|
||||
[connectivity]
|
||||
uri=http://nmcheck.gnome.org/check_network_status.txt
|
||||
interval=300
|
||||
|
||||
[device]
|
||||
wifi.scan-rand-mac-address=no
|
||||
|
@ -1,3 +1,4 @@
|
||||
[Time]
|
||||
NTP=time.cloudflare.com
|
||||
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
|
||||
FallbackNTP=time.cloudflare.com
|
||||
# Speed-up boot as first attempt is done before network is up
|
||||
ConnectionRetrySec=10
|
||||
|
42
buildroot-external/rootfs-overlay/usr/lib/NetworkManager/dispatcher.d/10-ntp
Executable file
42
buildroot-external/rootfs-overlay/usr/lib/NetworkManager/dispatcher.d/10-ntp
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
|
||||
TIMESYNCD_CONF=/run/systemd/timesyncd.conf.d/10-ntp.conf
|
||||
|
||||
timesyncd_dhcp_ntp_remove() {
|
||||
if [ -e $TIMESYNCD_CONF ]; then
|
||||
rm -f $TIMESYNCD_CONF
|
||||
systemctl restart systemd-timesyncd.service
|
||||
fi
|
||||
}
|
||||
|
||||
timesyncd_dhcp_ntp_add() {
|
||||
mkdir -p "$(dirname $TIMESYNCD_CONF)"
|
||||
|
||||
echo '[Time]' > ${TIMESYNCD_CONF}
|
||||
echo "NTP=${DHCP4_NTP_SERVERS}" >> ${TIMESYNCD_CONF}
|
||||
|
||||
systemctl restart systemd-timesyncd.service
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
INTERFACE=${1}
|
||||
ACTION=${2}
|
||||
|
||||
case ${ACTION} in
|
||||
up|down|dhcp4-change)
|
||||
if [ -n "${DHCP4_NTP_SERVERS}" ]
|
||||
then
|
||||
timesyncd_dhcp_ntp_add
|
||||
RETURN_CODE=$?
|
||||
else
|
||||
timesyncd_dhcp_ntp_remove
|
||||
RETURN_CODE=$?
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
RETURN_CODE=0
|
||||
;;
|
||||
esac
|
||||
|
||||
return $RETURN_CODE
|
Loading…
x
Reference in New Issue
Block a user