summaryrefslogtreecommitdiff
path: root/pm/sleep.d/01grub
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-02-16 09:56:30 -0600
committerVictor Lowther <victor.lowther@gmail.com>2008-02-16 09:56:30 -0600
commit436ebacce6b142b956d5f94d1bb8b0568343cd2f (patch)
treef1c7d29bbb65525b3386a4c30315f265a7520e68 /pm/sleep.d/01grub
parentc62130114d1207163c9ed4628a41657695388672 (diff)
Fix up 01grub to exit $NA when the hook is not applicable.
Also get rid of redundant calls to exit.
Diffstat (limited to 'pm/sleep.d/01grub')
-rw-r--r--pm/sleep.d/01grub14
1 files changed, 6 insertions, 8 deletions
diff --git a/pm/sleep.d/01grub b/pm/sleep.d/01grub
index ddc39ce..649a2b6 100644
--- a/pm/sleep.d/01grub
+++ b/pm/sleep.d/01grub
@@ -6,29 +6,27 @@ default_resume_kernel()
i?86|x86_64|athlon)
;;
*) # this is only valid for x86 and x86_64
- return 1
+ return $NA
;;
esac
- [ -x /sbin/grubby -a -x /sbin/grub ] || return 1
+ [ -x /sbin/grubby -a -x /sbin/grub ] || return $NA
[ -e "/boot/vmlinuz-$(uname -r)" ] || return 1
out=$(/sbin/grubby --info /boot/vmlinuz-$(uname -r) |grep index)
[ -n "${out}" ] || return 1
current=${out#index=}
- echo "savedefault --default=${current} --once" | /sbin/grub --batch --no-floppy --device-map=/boot/grub/device.map --no-curses >/dev/null
+ echo "savedefault --default=${current} --once" | \
+ /sbin/grub --batch --no-floppy --device-map=/boot/grub/device.map \
+ --no-curses >/dev/null
return 0
}
-RETVAL=0
case "$1" in
hibernate)
default_resume_kernel
- RETVAL=$?
;;
- *)
+ *) exit $NA
;;
esac
-
-exit $RETVAL