#!/bin/bash tasks="$(proxmox-backup-manager task list --output-format json)" if [ "$tasks" == '[]' ] then sleep 300; tasks="$(proxmox-backup-manager task list --output-format json)"; if [ "$tasks" == '[]' ] then sudo shutdown now; fi fi