summaryrefslogtreecommitdiffstats
path: root/hooks/resume
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-04-28 01:31:05 +0200
committerAaron Griffin <aaron@archlinux.org>2006-04-28 01:31:05 +0200
commit8fd8b1c7ff0a82c876d58106e904d1e6f6716db5 (patch)
tree189c00cf03244c9caa9dff60d48aeed18954227c /hooks/resume
parent117bb5ca93de53276a1f7b7e5d485779f71b5c1f (diff)
downloadmkinitcpio-8fd8b1c7ff0a82c876d58106e904d1e6f6716db5.tar.gz
mkinitcpio-8fd8b1c7ff0a82c876d58106e904d1e6f6716db5.tar.xz
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@35 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'hooks/resume')
-rw-r--r--hooks/resume17
1 files changed, 7 insertions, 10 deletions
diff --git a/hooks/resume b/hooks/resume
index 649b992..a5dee6e 100644
--- a/hooks/resume
+++ b/hooks/resume
@@ -3,15 +3,12 @@
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
+ if [ -e "/sys/power/resume" -a -e "${resume}" ]; then
+ dev_t=$( /bin/parseblock "${resume}" )
+ fmtdevice ${dev_t} > /sys/power/resume
+ fi
+ if [ -e "/proc/suspend2" -a "x${resume2}" != "x" ]; then
+ echo ${resume2} > /proc/suspend2/resume2
+ echo "" > /proc/suspend2/do_resume
fi
}