Skip to content

Commit

Permalink
Update contrib/nuke-graph-directory.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Brett Milford <brettmilford@gmail.com>
  • Loading branch information
brettmilford committed Apr 9, 2021
1 parent 398cb1d commit a0d1a1f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions contrib/nuke-graph-directory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ if command -v btrfs > /dev/null 2>&1; then
# Find btrfs subvolumes under $dir checking for inode 256
# Source: http://stackoverflow.com/a/32865333
for subvol in $(find "$dir" -type d -inum 256 | sort -r); do
if [ "$dir" != "$subvol" ]; then
if [ "$(stat -f --format=%T $subvol)" == "btrfs" ]; then
(
set -x
btrfs subvolume delete "$subvol"
)
fi
if [ "$dir" != "$subvol" ] && subvolType="$(stat -f --format=%T "$subvol")" && [ "$subvolType" = "btrfs" ]; then
(
set -x
btrfs subvolume delete "$subvol"
)
fi
done
fi
Expand Down

0 comments on commit a0d1a1f

Please sign in to comment.