From 1c4554e9e00a63bd58fabd855ec5af6f3667f89c Mon Sep 17 00:00:00 2001 From: Raphael Dannecker Date: Fri, 21 Jun 2024 15:45:16 +0200 Subject: [PATCH] Run VM-sync only when server is reachable. --- roles/lmn_vm/files/vm-run | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/lmn_vm/files/vm-run b/roles/lmn_vm/files/vm-run index a740bed..2fb0909 100755 --- a/roles/lmn_vm/files/vm-run +++ b/roles/lmn_vm/files/vm-run @@ -231,8 +231,11 @@ export XDG_CONFIG_HOME="/tmp/${UID}/.config" if ! virsh --connect="${QEMU}" list | grep "${VM_NAME}-clone"; then echo "VM not yet running." - sudo /usr/local/bin/desktop-sync - check_images + # only when school-network is reachable + if nslookup "${SEEDBOX_HOST}"; then + sudo /usr/local/bin/desktop-sync + check_images + fi if [[ "${NEWCLONE}" = 1 ]] || [[ ! -f "${VM_DIR}/${VM_NAME}-clone.qcow2" ]]; then create_clone "${VM_NAME}" fi