mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-06-24 21:30:33 -04:00
output
This commit is contained in:
parent
bb2f0a3c44
commit
822cf64618
1 changed files with 13 additions and 12 deletions
|
@ -15,27 +15,28 @@ kernel=$(echo "$cmdline" | grep -o 'BOOT_IMAGE=\S*' | cut -d '=' -f 2)
|
||||||
initrd=$(echo "$kernel" | sed "s#vmlinuz#initrd.img#")
|
initrd=$(echo "$kernel" | sed "s#vmlinuz#initrd.img#")
|
||||||
|
|
||||||
if ! test -r "$initrd"; then
|
if ! test -r "$initrd"; then
|
||||||
echo "$0: ERROR: Initrd File '$initrd' not found or not readable!"
|
echo "$0: ERROR: Initrd File '$initrd' not found or not readable!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! test -r "$kernel"; then
|
if ! test -r "$kernel"; then
|
||||||
echo "$0: ERROR: Kernel File '$kernel' not found or not readable!"
|
echo "$0: ERROR: Kernel File '$kernel' not found or not readable!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if systemctl list-jobs | grep "poweroff.target" | grep -q "start"; then
|
if systemctl list-jobs | grep "poweroff.target" | grep -q "start"; then
|
||||||
wiperamexit="yes"
|
wiperamexit="yes"
|
||||||
wiperamaction="poweroff"
|
wiperamaction="poweroff"
|
||||||
elif systemctl list-jobs | grep "reboot.target" | grep -q "start"; then
|
elif systemctl list-jobs | grep "reboot.target" | grep -q "start"; then
|
||||||
wiperamexit="yes"
|
wiperamexit="yes"
|
||||||
wiperamaction="reboot"
|
wiperamaction="reboot"
|
||||||
elif systemctl list-jobs | grep "halt.target" | grep -q "start"; then
|
elif systemctl list-jobs | grep "halt.target" | grep -q "start"; then
|
||||||
wiperamexit="yes"
|
wiperamexit="yes"
|
||||||
wiperamaction="halt"
|
wiperamaction="halt"
|
||||||
else
|
else
|
||||||
echo "$0: INFO: No shutdown option found!"
|
## Could be kexec.target.
|
||||||
exit 0
|
echo "$0: INFO: Neither poweroff, reboot or halt. Therefore skipping kexec load, ok."
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kexec -l "$kernel" --initrd="$initrd" --reuse-cmdline --append="wiperamexit=$wiperamexit wiperamaction=$wiperamaction"
|
kexec -l "$kernel" --initrd="$initrd" --reuse-cmdline --append="wiperamexit=$wiperamexit wiperamaction=$wiperamaction"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue