The script can run any arbitrary command and retrieve its exit code, wait for boot and skip the 5-second prompt (and optionally skip startup.nsh), or send reset/shutdown commands. Code written in (almost) pure BASH with no subprocesses spawned. Only print function calls ‘sed’ once.
https://github.com/artem-nefedov/uefi-qemu-communicator
PS: The author also wrote UEFI-GDB.
https://github.com/artem-nefedov/uefi-gdb