diff --git a/files/initrd/opt/rr/include/functions.sh b/files/initrd/opt/rr/include/functions.sh index 6de4b399..d9b7d881 100755 --- a/files/initrd/opt/rr/include/functions.sh +++ b/files/initrd/opt/rr/include/functions.sh @@ -343,10 +343,10 @@ function getLogo() { # 1 - mode function rebootTo() { MODES="config recovery junior" - [ -z "${1}" ] && exit 1 - if ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi + if [ -z "${1}" ] || ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi # echo "Rebooting to ${1} mode" GRUBPATH="$(dirname $(find ${PART1_PATH}/ -name grub.cfg 2>/dev/null | head -1))" + [ -z "${GRUBPATH}" ] && exit 1 ENVFILE="${GRUBPATH}/grubenv" [ ! -f "${ENVFILE}" ] && grub-editenv ${ENVFILE} create grub-editenv ${ENVFILE} set next_entry="${1}"