#!/bin/bash

next=$(efibootmgr | sed -n -E 's/^BootCurrent:\s*(\S+)$/\1/p')
[[ $next ]] && efibootmgr -n $next
reboot
