From a790ff054e76b5997cde294ad9674e448ec12d53 Mon Sep 17 00:00:00 2001 From: Antynea Date: Thu, 7 Oct 2021 17:31:45 +0200 Subject: [PATCH] "disable_script" function breaks "grub-mkconfig" * "disable_script" function breaks "grub-mkconfig": * Replace "return 1" by "exit 0". --- 41_snapshots-btrfs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/41_snapshots-btrfs b/41_snapshots-btrfs index ecc2b0f..5ef03fb 100755 --- a/41_snapshots-btrfs +++ b/41_snapshots-btrfs @@ -45,15 +45,12 @@ grub_btrfs_config="${sysconfdir}/default/grub-btrfs/config" ## Exit the script, if: disable_script() { - # Disable Grub-btrfs is set to true (default=false) - [[ "${GRUB_BTRFS_DISABLE:-"false"}" == "true" ]] && return 1 - # btrfs-progs isn't installed - if ! type btrfs >/dev/null 2>&1; then return 1; fi - # grub-mkconfig_lib couldn't be found - [[ -f "$datarootdir/grub/grub-mkconfig_lib" ]] && . "$datarootdir/grub/grub-mkconfig_lib" || return 1 + [[ "${GRUB_BTRFS_DISABLE:-"false"}" == "true" ]] && exit 0 # Disable Grub-btrfs is set to true (default=false) + if ! type btrfs >/dev/null 2>&1; then exit 0; fi # btrfs-progs isn't installed + [[ -f "$datarootdir/grub/grub-mkconfig_lib" ]] && . "$datarootdir/grub/grub-mkconfig_lib" || exit 0 # grub-mkconfig_lib couldn't be found # Root filesystem isn't btrfs root_fs=$(${grub_probe} --target="fs" / 2>/dev/null) - [[ "$root_fs" != "btrfs" ]] && return 1 + [[ "$root_fs" != "btrfs" ]] && exit 0 return 0 } disable_script