I wanted to use the same script in /etc/zzz.d/resume and /etc/zzz.d/suspend . By evaluating the ZZZ_MODE environment variable I thought I could decide what to do, but the ZZZ_MODE variable never is "resume" . When sleeping to memory it is "suspend" when the suspend hook is called and also when the resume hook is called. Of course if I could use a dedicated resume hook where I do not need to look at ZZZ_MODE at all, but in my understanding the manage suggested that ZZZ_MODE would be "resume" when resuming, but that's not the case.
I was able to fix it for me by adding
export ZZZ_MODE=resume right before the resume hooks are called.
I wanted to use the same script in /etc/zzz.d/resume and /etc/zzz.d/suspend . By evaluating the ZZZ_MODE environment variable I thought I could decide what to do, but the ZZZ_MODE variable never is "resume" . When sleeping to memory it is "suspend" when the suspend hook is called and also when the resume hook is called. Of course if I could use a dedicated resume hook where I do not need to look at ZZZ_MODE at all, but in my understanding the manage suggested that ZZZ_MODE would be "resume" when resuming, but that's not the case.
I was able to fix it for me by adding
export ZZZ_MODE=resumeright before the resume hooks are called.