Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
External semaphore to only invoke
sleepnow
once
Credit goes to @benbosman Fixes #2 I've slightly modified original script, specifically: - removed `sleep 10` altogether, since it's not reliable, and adds unpredictable side effects; - removed parenthesis and ampersand around `pmset sleepnow` so that the script only exits when this command does; - used a temporary file as semaphore. It might attempt to put the sleeping machine to sleep again because of the change in semaphore file name in between script runs (as $TMPDIR changes), but it won't be doing that in two second intervals causing failures. - some cosmetics
- Loading branch information