mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
fix rebootTo
This commit is contained in:
parent
46598132fd
commit
9dba6e5a6f
@ -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}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user