title: How to deny a poweroff without killing a running script that will execute it?
body: <p>I have a backup script that executes the poweroff command to shutdown my machine once all backups are finished. However it happens that I want to deny the poweroff, but without killing the script process, as it would corrupt my backup and leave a bad mess.</p>
  
  <p>How can I make the poweroff not execute without pausing or killing the script?</p>
  
  <p>Here's my script:</p>
  
  <pre><code>#!/bin/bash
  /unfa/Scripts/Daily\ backup/backup.sh &gt; ~/backup-unfa.log; echo "data thread finished" &amp;
  /mnt/system-backup/system-backup.sh &gt; ~/backup-system.log; echo "system thread finished" &amp;
  
  sleep 1m
  while [[ -n $(pgrep rdiff-backup) ]]
  do echo "Backing up yo data, dude..."; sleep 3s
  done
  echo "POWER OFF"
  poweroff
  </code></pre>