MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib64/pm-utils/sleep.d/01grub
#!/bin/sh
# Ensure grub will load the correct kernel on resume from hibernate,
# TODO: This is rather redhat specific, and very grub specific.

default_resume_kernel()
{
        [ "$1" = "suspend" ] && return $NA
	case $(uname -m) in
		i?86|x86_64|athlon)
	    		;;
		*) # this is only valid for x86 and x86_64
			return $NA
	    		;;
	esac

	[ -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 --device-map=/boot/grub/device.map \
		--batch --no-floppy --no-curses >/dev/null

	return 0
}

case "$1" in
	hibernate|suspend)
		default_resume_kernel $2
		;;
	*) exit $NA
		;;
esac