#!/bin/sh

# Enable NTP syncing if it's enabled before upgrade, or on a fresh install.
# Use path in /userdata/ because this path is not longer writable.
# Check .disabled so that we don't have to check explicitly for fresh install.
if ! [ -e "/userdata/system-data/etc/network/if-up.d/ntpdate.disabled" ]; then
    timedatectl set-ntp on
fi

# Disable ourselves, so that we won't run the second time.
systemctl mask enable-timesyncd-by-default.service
