From c09f4da1922f40f666dae0570295b5ab5c02e8a9 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Sat, 7 Jan 2023 15:06:56 -0500 Subject: [PATCH] code simplification --- .../security-misc/cold-boot-attack-defense-kexec-prepare | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr/libexec/security-misc/cold-boot-attack-defense-kexec-prepare b/usr/libexec/security-misc/cold-boot-attack-defense-kexec-prepare index 0315f3e..48dc3e6 100755 --- a/usr/libexec/security-misc/cold-boot-attack-defense-kexec-prepare +++ b/usr/libexec/security-misc/cold-boot-attack-defense-kexec-prepare @@ -14,16 +14,12 @@ cmdline=$(cat /proc/cmdline) kernel=$(echo "$cmdline" | grep -o 'BOOT_IMAGE=\S*' | cut -d '=' -f 2) initrd=$(echo "$kernel" | sed "s#vmlinuz#initrd.img#") -if test -e "$initrd"; then - echo "$0: INFO: Initrd File Found" -else +if ! test -e "$initrd"; then echo "$0: ERROR: Initrd File NOT FOUND" exit 1 fi -if test -e "$kernel"; then - echo "$0: INFO: Kernel File Found" -else +if ! test -e "$kernel"; then echo "$0: ERROR: Kernel File NOT FOUND" exit 1 fi