summaryrefslogtreecommitdiffstats
path: root/hooks/sleep
blob: 72fc503093f9c63cf825e5ae0bbef381a9e508cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/ash

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
}

# vim: set ft=sh ts=4 sw=4 et: