grub-pc (2.02~beta2-36ubuntu3.10)

I’m running an Ubuntu server and the other day while running updates I started getting the following error:

Setting up grub-pc (2.02~beta2-36ubuntu3.10) ...
/var/lib/dpkg/info/grub-pc.postinst: line 703: syntax error near unexpected token `fi'
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)

Opening /var/lib/dpkg/info/grub-pc.postinst I found:

        if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10 then
          if [ -e "/boot/efi/EFI/${bootloader_id}/fbx64.efi" ]; then
            rm -f "/boot/efi/EFI/${bootloader_id}/fbx64.efi";
          fi
        fi

There was a missing semicolon in the first line and that’s what was breaking my update. I updated it and the error went away:

        if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10; then
          if [ -e "/boot/efi/EFI/${bootloader_id}/fbx64.efi" ]; then
            rm -f "/boot/efi/EFI/${bootloader_id}/fbx64.efi";
          fi
        fi