#!/usr/bin/env bash

# Nomarchy Time Sync Script
# Force sync system time using systemd-timesyncd

set -e

echo "Syncing system time..."
if ! sudo systemctl restart systemd-timesyncd; then
    echo "Error: Failed to restart systemd-timesyncd. Check internet connection."
    exit 1
fi

# Wait a moment for sync
sleep 2

echo "Current time: $(date)"
echo "Time sync complete."
