From 895491a83141755182f680a6d2a35b54625e531e Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 22 Jun 2023 08:37:11 +0200 Subject: [PATCH] boot tool: always check first if hookfile exists Signed-off-by: Thomas Lamprecht --- src/proxmox-boot/zz-proxmox-boot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proxmox-boot/zz-proxmox-boot b/src/proxmox-boot/zz-proxmox-boot index 9710e03..f068de2 100755 --- a/src/proxmox-boot/zz-proxmox-boot +++ b/src/proxmox-boot/zz-proxmox-boot @@ -205,7 +205,7 @@ disable_systemd_boot_hook() { "/etc/kernel/postinst.d/zz-systemd-boot" \ "/etc/kernel/postrm.d/zz-systemd-boot" ; \ do - if ! grep -q "$marker" "$hookfile"; then + if [ -e "$hookfile" ] && ! grep -q "$marker" "$hookfile"; then warn " Disabling upstream hook $hookfile" printf "#!/bin/sh\n\n%s\nexit 0\n" "$marker" > "$hookfile.pbt.tmp" cat "$hookfile" >> "$hookfile.pbt.tmp" -- 2.39.2