Fix : GRUB_BTRFS_LIMIT (Limit the number of snapshots populated in the GRUB menu.)

Fix : When a value =< 0, script stop correctly
fix : When a value => 1, script stop when the value is reached

e.g :
 - GRUB_BTRFS_LIMIT="0"
   script doesn't detect snapshot

 - GRUB_BTRFS_LIMIT"1" or "2" "etc..."
   script will stop the snapshot detection when value is reached
This commit is contained in:
Antynea
2016-04-22 15:29:38 +02:00
parent 87a94c19c2
commit f0c50d1d76

View File

@@ -274,6 +274,8 @@ list_kernels_initramfs()
IFS=$'\n'
count_limit_snap=0
for item in $(snapshot_list); do
### fix: limit_snap_show=0
[[ ${limit_snap_show} -le 0 ]] && break;
IFS=$oldIFS
item=($item)
snap_dir_name=${item[@]:2:${#item[@]}}
@@ -314,11 +316,9 @@ list_kernels_initramfs()
title_format
# echo "${title_menu[*]}"
snapshots_entry
### Limit snapshots found during run "grub-mkconfig"
count_limit_snap=$((1+$count_limit_snap))
if [[ $count_limit_snap -gt $limit_snap_show ]]; then
break;
fi
### Limit snapshots found during run "grub-mkconfig"
count_limit_snap=$((1+$count_limit_snap))
[[ $count_limit_snap -ge $limit_snap_show ]] && break;
done
IFS=$oldIFS
}