summaryrefslogtreecommitdiffstats
path: root/hooks/resume
blob: 649b99252a9c6c06e62e6eef6c0e1cb2969b370e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# vim:set ft=sh:
# TODO encrypted swap partition if resume2 begins with 'swap:'
run_hook ()
{
    fmtdevice () { echo "${1}:${2}"; }
    if [ -e "/sys/power/resume" ]; then
        if [ -e "${resume}" ]; then
            dev_t=$( /bin/parseblock "${resume}" )
            fmtdevice ${dev_t} > /sys/power/resume
        fi

        if [ -e "/proc/suspend2" ]; then
            echo "" > /proc/suspend2/do_resume
            echo ${resume2} > /proc/suspend2/resume2
        fi
    fi
}