Last active
August 1, 2024 20:16
-
-
Save mirkobrombin/69d49deac0a56e6083f99d3cf33ea921 to your computer and use it in GitHub Desktop.
vos-recovery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p /mnt/boot /mnt/init | |
mount LABEL=vos-init /mnt/init | |
mount LABEL=vos-boot /mnt/boot | |
first_line=$(head -n 1 /mnt/boot/grub/grub.cfg) | |
if echo "$first_line" | grep -q "set default=0"; then | |
X="a" | |
elif echo "$first_line" | grep -q "set default=1"; then | |
X="b" | |
else | |
echo "Error: Unexpected content in grub.cfg" | |
exit 1 | |
fi | |
echo "your GRUB is in: /mnt/init/vos-$X/abroot.cfg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment