diff --git a/autoShutdown b/autoShutdown new file mode 100755 index 0000000..fd5cbb3 --- /dev/null +++ b/autoShutdown @@ -0,0 +1,12 @@ +#!/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 diff --git a/poweroff b/poweroff deleted file mode 100755 index 00772a0..0000000 --- a/poweroff +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -tasks="(proxmox−backup−managertasklist−−output−formatjson)" -if["$tasks" == '[]' ] -then - sleep 300; - tasks="(proxmox−backup−managertasklist−−output−formatjson)"; - if["$tasks" == ’[]’ ] - then - shutdown now; - fi -fi