Commit 3c540e8
committed
External semaphore to only invoke
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 cosmeticssleepnow once1 parent 3bb8710 commit 3c540e8
2 files changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
6 | 13 | | |
0 commit comments