From 79de6f5fd6e92652a40d7e3d2bc16355f8956e61 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 3 Jun 2013 20:18:09 +0200 Subject: [PATCH] initrd.scripts: text if ${device} is set before messing with /sys/power --- defaults/initrd.scripts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 93a3463..f98bc1a 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1272,7 +1272,8 @@ do_resume() { swsusp_resume() { # determine swap resume partition local device=$(ls -lL "${REAL_RESUME}" | sed 's/\ */ /g' | cut -d \ -f 5-6 | sed 's/,\ */:/') - [ -f /sys/power/resume ] && echo "${device}" > /sys/power/resume + [ -f /sys/power/resume -a -n "${device}" ] && \ + echo "${device}" > /sys/power/resume } tuxonice_resume() {