summaryrefslogtreecommitdiff
path: root/pm/sleep.d/01grub
diff options
context:
space:
mode:
Diffstat (limited to 'pm/sleep.d/01grub')
-rw-r--r--pm/sleep.d/01grub23
1 files changed, 10 insertions, 13 deletions
diff --git a/pm/sleep.d/01grub b/pm/sleep.d/01grub
index 7c528ab..7fa356a 100644
--- a/pm/sleep.d/01grub
+++ b/pm/sleep.d/01grub
@@ -4,31 +4,28 @@ default_resume_kernel()
{
case $(uname -m) in
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 --device-map=/boot/grub/device.map \
+ --batch --no-floppy --no-curses >/dev/null
+
return 0
}
-RETVAL=0
case "$1" in
hibernate)
default_resume_kernel
- RETVAL=$?
;;
- *)
+ *) exit $NA
;;
esac
-
-exit $RETVAL