Skip to content
Snippets Groups Projects
Commit 36a33c32 authored by nimrod's avatar nimrod
Browse files

Handle cases where there are no btrfs volumes.

parent 24cb8ceb
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,9 @@ for mp in $(lsblk --list --noheadings --output fstype,mountpoint | \
awk '$1 == "btrfs" {print $2}' | \
sort -u)
do
# In case there are no btrfs volumes, the for loop will execute once with an
# empty string for mp. Validate that indeed we're passed a mountpoint.
[ -d "$mp" ] || continue
status="$(btrfs scrub status "$mp" | awk '$1 == "Status:" {print $2}')"
if [ "$status" = 'running' ]
then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment