summaryrefslogtreecommitdiffstats
path: root/hooks/sleep
blob: 50f3db3b81ce38b2b8eb3ed76469b84806b22d00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# vim:set ft=sh:
run_hook ()
{
    if [ -z "${sleeptime}" ] || ! [ "${sleeptime}" -gt 0 ]; then
        sleeptime=5
    fi
    if [ -n "${sleepdevice}" ]; then
        poll_device "${sleepdevice}" ${sleeptime}
    else
        msg "Sleeping for ${sleeptime} seconds."
        sleep ${sleeptime}
    fi
}