summaryrefslogtreecommitdiffstats
path: root/hooks/sleep
diff options
context:
space:
mode:
Diffstat (limited to 'hooks/sleep')
-rw-r--r--hooks/sleep8
1 files changed, 6 insertions, 2 deletions
diff --git a/hooks/sleep b/hooks/sleep
index bade71a..50f3db3 100644
--- a/hooks/sleep
+++ b/hooks/sleep
@@ -4,6 +4,10 @@ run_hook ()
if [ -z "${sleeptime}" ] || ! [ "${sleeptime}" -gt 0 ]; then
sleeptime=5
fi
- msg "Sleeping for ${sleeptime} seconds."
- sleep ${sleeptime}
+ if [ -n "${sleepdevice}" ]; then
+ poll_device "${sleepdevice}" ${sleeptime}
+ else
+ msg "Sleeping for ${sleeptime} seconds."
+ sleep ${sleeptime}
+ fi
}