2010-07-06 16:22:34 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. "${PM_FUNCTIONS}"
|
|
|
|
|
|
|
|
sync_qubes_vms_wallclock()
|
|
|
|
{
|
2012-02-09 11:08:29 +01:00
|
|
|
# Sync all VMs based on dom0 clock
|
|
|
|
DATE=$(date)
|
|
|
|
echo
|
|
|
|
echo "Syncing VMs clock to: $DATE"
|
|
|
|
qvm-run --all --exclude=`qubes-prefs --get clockvm` -u root "date -s \"$DATE\""
|
|
|
|
# Then try to sync from the network
|
|
|
|
/usr/bin/qvm-sync-clock &
|
2010-07-06 16:22:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
2012-02-01 18:22:44 +01:00
|
|
|
thaw|resume) sync_qubes_vms_wallclock ;;
|
2012-02-09 11:33:55 +01:00
|
|
|
# Kill qvm-sync-clock (if running) to not desync time after resume
|
|
|
|
suspend|hibernate) killall qvm-sync-clock 2> /dev/null ;;
|
2010-07-06 16:22:34 +02:00
|
|
|
*) exit 0 ;;
|
|
|
|
esac
|