Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System gets shutdown after sleep wake-up if using custom after wake-up code #59

Open
Falcosc opened this issue May 30, 2022 · 0 comments

Comments

@Falcosc
Copy link
Contributor

Falcosc commented May 30, 2022

I guess this line is the problem

[[ $action == sleep ]] && system_sleep || system_down

If you have a post wake up script which exits with 1 instead of 0 the condition is false, and it will execute system_down.

My last line of the post sleep script which is causing this issue uses the "Test" function, and this will set the exit code to 1.

test "$(date +%s -d "60 days ago")" -gt "$(mdcmd status | sed -n 's/sbSynced=//p')" && /usr/local/sbin/mdcmd check NOCORRECT &> /dev/null

This executes the parity check if it was older than 60 days because crone schedule does not work if the system does sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant