Run script on resume
I am trying to run a script on resume after system suspend. Placed a script called test in /lib/systemd/system-sleep. Set the execution bit.
#!/usr/bin/env bash # # useless test script # echo "Reached test script at $(date)" >> tmp/result.txt case "$1/$2" in pre) echo "we are suspending at $(date)..." >> tmp/result.txt ;; post) echo "we restarted at $(date)" >> tmp/result.txt ;; esac The script properly appends "Reached test script at $(date)" in tmp/result.txt when ran from terminal. There is nothing placed in tmp/result.txt on suspend or resume. journalctl -u systemd-suspend.service doesn't show any error messages. Anyone have any idea what is wrong? |
#1 you are using relative rather than absolute paths, without setting the current path in the script.
I have some other thoughts, but fix that and see if that is sufficient. |
Quote:
Thanks Kim Foltz |
All times are GMT -5. The time now is 04:33 AM. |