Files
bananarchy/overlay/rootfs/usr/bin/bananarchy-sync-net-time.sh
T

23 lines
625 B
Bash
Raw Normal View History

2026-11-07 22:22:02 +02:00
#!/bin/sh
# Config -> Sync net time: force an immediate NTP sync and show the outcome.
# Runs as the X session user; bananarchy-time-sync.sh escalates via doas.
set -u
result="$(/usr/bin/bananarchy-time-sync.sh sync 2>&1)"
[ -n "$result" ] || result="No response from chronyd"
case "$result" in
"Network time synced"*)
urgency=normal
;;
*)
urgency=critical
;;
esac
if command -v notify-send >/dev/null 2>&1; then
notify-send --urgency="$urgency" --expire-time=8000 \
"Sync net time" "$result" >/dev/null 2>&1 || true
else
sxmo_notify_user.sh "Sync net time: $result" >/dev/null 2>&1 || true
fi