AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.22.74.46
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/977/cwd/lib64/pm-utils/sleep.d/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /proc/977/cwd/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()
{
	local g2reboot
	[ "$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 -o -r /etc/grub2.cfg \) ] || \
		return $NA
	[ -e "/boot/vmlinuz-$(uname -r)" ] || return 1
	out=$(/sbin/grubby --info /boot/vmlinuz-$(uname -r) |grep index | \
		head -n 1)
	[ -n "${out}" ] || return 1
	current=${out#index=}
	if [ -r /etc/grub2.cfg ]; then
		# to enable this functionality in grub2
		# GRUB_DEFAULT=saved is needed in /etc/default/grub
		# if you want to be able to by-pass the selection in the
		# boot menu, also use GRUB_SAVEDEFAULT=true
		g2reboot=`which grub2-reboot 2>/dev/null` || \
			g2reboot=`which grub-reboot 2>/dev/null` || return $NA
		$g2reboot ${current} > /dev/null
	else
		echo "savedefault --default=${current} --once" | \
			/sbin/grub --device-map=/boot/grub/device.map \
			--batch --no-floppy --no-curses >/dev/null
	fi

	return 0
}

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

Anon7 - 2022
AnonSec Team