From a0b7362fc58e41106f83d03b22fa35d095d713ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 23 Oct 2024 07:54:18 +0200 Subject: [PATCH] fix-sd: recheck after cleanup --- .bin/fix-sd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bin/fix-sd.sh b/.bin/fix-sd.sh index 0a24fa9..456a8ff 100755 --- a/.bin/fix-sd.sh +++ b/.bin/fix-sd.sh @@ -8,7 +8,8 @@ backup_directory="$(pwd)" trap clean EXIT clean() { umount "$mountpoint" - rm "$mountpoint" + rmdir "$mountpoint" + fsck.exfat "$drive" } filenames="$(fsck.exfat "$drive" 2>&1 | sed -nE "s/.* file '(.*?)' is not allocated.*/\1/p")" @@ -18,4 +19,3 @@ mount "$drive" "$mountpoint" echo "$filenames" | while read -r filename; do find "$mountpoint" -type f -name "$filename" -exec mv {} "$backup_directory" \; done -