From 6fed819dc23a84f332bada98240b1049a8a0d2ef Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 13 Apr 2021 11:39:54 +0200 Subject: [PATCH] proxmox-backup-file-restore: fix various postinst bugs/bad-behavior 1. The exit was never called as `test ... || echo "foo" || exit 1` can never come to the exit, as echo will not fail 2. The echo was meant to be redirected to stderr (FD #2) but it was actually redirected to a file named '2' Signed-off-by: Thomas Lamprecht --- debian/proxmox-backup-file-restore.postinst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/proxmox-backup-file-restore.postinst b/debian/proxmox-backup-file-restore.postinst index bb039fae..27eb87e9 100755 --- a/debian/proxmox-backup-file-restore.postinst +++ b/debian/proxmox-backup-file-restore.postinst @@ -11,9 +11,10 @@ update_initramfs() { # not want an unuseable image lying around rm -f "$CACHE_PATH" - [ -f "$INST_PATH/initramfs.img" ] || \ - echo "proxmox-backup-restore-image is not installed correctly" >2 || \ - exit 1 + if [ ! -f "$INST_PATH/initramfs.img" ]; then + echo "proxmox-backup-restore-image is not installed correctly, skipping update" >&2 + exit 0 + fi echo "Updating file-restore initramfs..."