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 <t.lamprecht@proxmox.com>
This commit is contained in:
		
							
								
								
									
										7
									
								
								debian/proxmox-backup-file-restore.postinst
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								debian/proxmox-backup-file-restore.postinst
									
									
									
									
										vendored
									
									
								
							@ -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..."
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user