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