mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-23 01:03:35 +07:00
output
This commit is contained in:
parent
bb2f0a3c44
commit
822cf64618
@ -15,27 +15,28 @@ kernel=$(echo "$cmdline" | grep -o 'BOOT_IMAGE=\S*' | cut -d '=' -f 2)
|
||||
initrd=$(echo "$kernel" | sed "s#vmlinuz#initrd.img#")
|
||||
|
||||
if ! test -r "$initrd"; then
|
||||
echo "$0: ERROR: Initrd File '$initrd' not found or not readable!"
|
||||
exit 1
|
||||
echo "$0: ERROR: Initrd File '$initrd' not found or not readable!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! test -r "$kernel"; then
|
||||
echo "$0: ERROR: Kernel File '$kernel' not found or not readable!"
|
||||
exit 1
|
||||
echo "$0: ERROR: Kernel File '$kernel' not found or not readable!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if systemctl list-jobs | grep "poweroff.target" | grep -q "start"; then
|
||||
wiperamexit="yes"
|
||||
wiperamaction="poweroff"
|
||||
wiperamexit="yes"
|
||||
wiperamaction="poweroff"
|
||||
elif systemctl list-jobs | grep "reboot.target" | grep -q "start"; then
|
||||
wiperamexit="yes"
|
||||
wiperamaction="reboot"
|
||||
wiperamexit="yes"
|
||||
wiperamaction="reboot"
|
||||
elif systemctl list-jobs | grep "halt.target" | grep -q "start"; then
|
||||
wiperamexit="yes"
|
||||
wiperamaction="halt"
|
||||
wiperamexit="yes"
|
||||
wiperamaction="halt"
|
||||
else
|
||||
echo "$0: INFO: No shutdown option found!"
|
||||
exit 0
|
||||
## Could be kexec.target.
|
||||
echo "$0: INFO: Neither poweroff, reboot or halt. Therefore skipping kexec load, ok."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
kexec -l "$kernel" --initrd="$initrd" --reuse-cmdline --append="wiperamexit=$wiperamexit wiperamaction=$wiperamaction"
|
||||
|
Loading…
Reference in New Issue
Block a user