diff options
-rw-r--r-- | hooks/sleep | 8 | ||||
-rw-r--r-- | install/sleep | 3 |
2 files changed, 9 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 } diff --git a/install/sleep b/install/sleep index f7f82bd..a59d0c3 100644 --- a/install/sleep +++ b/install/sleep @@ -15,5 +15,8 @@ cat <<HELPEOF for a fixed time interval. The time in seconds can be specified in the sleeptime= command line parameter. The default is 5 seconds. + If a sleepdevice= parameter is specified, sleep + until the given device node is available, polling + at one second intervals until sleeptime is reached. HELPEOF } |