aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-04-27 13:08:56 -0500
committerSlack Coder <slackcoder@server.ky>2024-04-27 13:08:56 -0500
commit28613aefdeca15ff5a857adf9d5d2b3dd4fdf53f (patch)
tree9ba9f9d71458b4b21ad6d9adbfe17cf9f84e6c4a
parente82682aef783dec0bc5383b146eae8e05185c6f1 (diff)
downloadefi-sync-28613aefdeca15ff5a857adf9d5d2b3dd4fdf53f.tar.xz
Fix logging
Avoid emitting successful messages about installation when an error occurs.
-rw-r--r--efi-sync10
1 files changed, 8 insertions, 2 deletions
diff --git a/efi-sync b/efi-sync
index 585b59f..331ce06 100644
--- a/efi-sync
+++ b/efi-sync
@@ -56,11 +56,17 @@ efi_install () {
KERNEL_VERSION="$(basename $(realpath "$KERNEL") | sed -E 's/vmlinuz-(.*)-(.*)/\2/')"
- cp -H "$KERNEL" "${EFI_KERNEL}"|| log "Failed to copy '${KERNEL}' into your EFI at '${EFI_KERNEL}'."
+ if ! cp -H "$KERNEL" "${EFI_KERNEL}"; then
+ log "Failed to copy '${KERNEL}' into your EFI at '${EFI_KERNEL}'."
+ return 1
+ fi
log "Installed $(realpath "$KERNEL")."
if [[ -f /etc/mkinitrd.conf ]]; then
- mkinitrd -F -c -k "${KERNEL_VERSION}" >/dev/null 2>&1 || log "mkinitrd failed to build and install your initial ramdisk."
+ if ! mkinitrd -F -c -k "${KERNEL_VERSION}" >/dev/null 2>&1; then
+ log "mkinitrd failed to build and install your initial ramdisk."
+ return 1
+ fi
log "Installed the initial RAM disk for kernel version '${KERNEL_VERSION}'."
fi
}