core-admin/dom0/aux-tools/keep-dom0-clock-synced
Marek Marczykowski e4e661ac51 dom0: reduce watching tool to dom0 clock sync only
Do not watch for updates for now, it will be implemented later.
2011-09-15 13:32:06 +02:00

30 lines
479 B
Bash
Executable File

#!/bin/sh
# 6h
UPDATES_SLEEP=21600
UPDATES_VM=`qvm-get-updatevm`
QREXEC_CLIENT=/usr/lib/qubes/qrexec_client
if [ -z "$UPDATES_VM" ]; then
echo "UpdateVM not set, exiting!" >&2
exit 1
fi
if ! xl domid "$UPDATES_VM" > /dev/null 2>&1; then
echo "UpdateVM not started, exiting!"
exit 1
fi
(
# Allow only one instance
flock --nonblock -s 200 || exit 1
while true; do
qvm-sync-dom0-clock
sleep $UPDATES_SLEEP
done
) 200> /var/run/qubes/clock-watch-lock