grub-btrfsd: change condition to run script

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
This commit is contained in:
Pascal Jäger
2023-03-21 09:54:42 +01:00
committed by Pascal J
parent 0745117a76
commit 8028a4376a

View File

@@ -203,12 +203,19 @@ fi
create_grub_menu() {
# create the grub submenu of the whole grub menu, depending on wether the submenu already exists
# and gives feedback if it worked
if [ -x "/etc/grub.d/41_snapshots-btrfs" ]; then
/etc/grub.d/41_snapshots-btrfs
log "Grub submenu recreated" "${GREEN}"
if grep "snapshots-btrfs" "{grub_directory}/grub.cfg"; then
if /etc/grub.d/41_snapshots-btrfs; then
log "Grub submenu recreated" "${GREEN}"
else
err "[!] Error during grub submenu creation (grub-btrfs error)" "${RED}"
err "[!] Error during grub submenu creation (grub-btrfs error)" "${RED}"
fi
else
if ${GRUB_BTRFS_MKCONFIG:-grub-mkconfig} -o ${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub.cfg; then
log "Grub menu recreated" "${GREEN}"
else
err "[!] Error during grub menu creation (grub/ grub-btrfs error)" "${RED}"
fi
fi
}
set_snapshot_dir() {