Is there a way to prevent shutdown on macOS while a particular bash script is running without changing the actual shutdown command?
This question has some linux based solutions that would probably work by aliasing the shutdown command, but I am just wary of doing it this way. Call it a lack of knowledge combined with a desire to not alter more than I need to.
This question asks essentially what I am asking but the accepted (and only) answer pertains only to sleep.
Ideally a solution will provide some way to prevent shutdown from within the bash script that is running. If this is not possible, the answer that requires the fewest changes elsewhere will be the best one.