Verified Commit 8139f77f authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

schroot-create: findmnt doesn't really work the way I'd like it to



it doesn't list all mountpoints under a directory, but only if that directory matches a current mountpoint, apparently

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 94edf625
...@@ -56,7 +56,7 @@ cleanup() { ...@@ -56,7 +56,7 @@ cleanup() {
cd cd
if [ -d "$SCHROOT_TARGET" ]; then if [ -d "$SCHROOT_TARGET" ]; then
local i local i
for i in $(findmnt -l -c | awk '{print $1}' | grep "^$SCHROOT_TARGET"); do for i in $(mount | awk '{print $3}' | grep "^$(realpath "$SCHROOT_TARGET")"); do
sudo umount "$i" sudo umount "$i"
done done
sudo rm -rf --one-file-system "$SCHROOT_TARGET" || ( echo "Warning: $SCHROOT_TARGET could not be fully removed during cleanup." ; ls "$SCHROOT_TARGET" -la ) sudo rm -rf --one-file-system "$SCHROOT_TARGET" || ( echo "Warning: $SCHROOT_TARGET could not be fully removed during cleanup." ; ls "$SCHROOT_TARGET" -la )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment