Commit 36a33c32 authored by nimrod's avatar nimrod
Browse files

Handle cases where there are no btrfs volumes.

parent 24cb8ceb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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