Yes, suspending your computer is stopping the script.
It will not Auto-resume itself because no part of it tells it to do so. It is not being stopped from resuming, because no part of the script tells it to resume in the first place.
Resuming your session does not automatically resume your script for you.
When you suspend the computer by closing the lid, this translates to you saying to the computer, “I would like to suspend the machine, if that is alright with you.”
If there are background processes running that it needs to finish, it will continue until finished without suspending. So let’s say you close the lid, it kills the Screen and Backlight, but continues to run until those processes are complete. This does not always happen, maybe about ten percent of the time or a bit more or a bit less… It happens when a process still running must finish before closing. This can last a few seconds, a few minutes or if there is a loop, can last several hours.
Once it suspends, then the script is stopped. It cannot resume without being told, either by you starting it or by you including a part in the script that tells itself to resume. I think you are thinking that if the script is to execute a command every second, then it should do so within 1 second. But it cannot do so at all unless the Script is Started.
The script can be started with a Resume function in the script, for example:
#!/bin/sh
case “$1” in
hibernate|suspend)
;;
thaw|resume)
vlock -ans
;;
*) exit $NA
;;
esac
And the script placed in your /lib/systemd/system-sleep/ folder
I pointed to the above documentation on your computer.
Stack is a good choice, too.
Other references that may help:


