From time to time I hibernate (suspend to disk) my machine using a shell script. Sometimes the procedure fails and the system does not hibernate at all or wakes up by itself shortly after it was suspended. Earlier, I used a tool which returned only after the system had resumed from hibernation (or immediately in case of an error) - so it was easy to distinguish between a successful and unsuccessful hibernation by merely checking the exit code and time which elapsed between the hibernation attempt and resume: if it was shorter than a certain threshold, I assumed that hibernation was unsuccessful, and I could take some recovery steps.
Now I have to use systemctl hibernate - which in general is ok, except that it asks the system to hibernate and returns immediately, while the hibernation works in background. Is there a simple method to check whether the system hibernated successfully in such circumstances?
I use OpenSUSE Leap 42.3, kernel version 4.4.104.