After gemini-propoesed fixes
This commit is contained in:
parent
2e31283b61
commit
83324dd0f7
11 changed files with 228 additions and 307 deletions
|
|
@ -1,16 +1,27 @@
|
|||
#!/bin/bash
|
||||
DIR="$@"
|
||||
# Lackadaisical squashfs tools - Unmount
|
||||
|
||||
DIR="$1"
|
||||
if [[ -z "$DIR" ]]; then
|
||||
echo "Usage: $0 <directory>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR=$(readlink -f "$DIR")
|
||||
DIR_SHORT=$(basename "$DIR")
|
||||
|
||||
OVERLAY_ROOT=$(readlink -f "${DIR}/..")/.squashfs/${DIR_SHORT}
|
||||
OVERLAY_UPPER=${OVERLAY_ROOT}/upper
|
||||
OVERLAY_LOWER=${OVERLAY_ROOT}/lower
|
||||
OVERLAY_WORK=${OVERLAY_ROOT}/work
|
||||
OVERLAY_TARG=$DIR
|
||||
OVERLAY_ROOT="$(dirname "$DIR")/.squashfs/$DIR_SHORT"
|
||||
OVERLAY_LOWER="$OVERLAY_ROOT/lower"
|
||||
OVERLAY_TARG="$DIR"
|
||||
|
||||
sudo umount -R "$OVERLAY_TARG" 2>/dev/null
|
||||
sudo umount -R "$OVERLAY_LOWER" 2>/dev/null
|
||||
# Forcefully unmount both layers recursively
|
||||
sudo umount -l -R "$OVERLAY_TARG" 2>/dev/null
|
||||
sudo umount -l -R "$OVERLAY_LOWER" 2>/dev/null
|
||||
|
||||
if mountpoint -q "$OVERLAY_TARG" || mountpoint -q "$OVERLAY_LOWER"; then
|
||||
echo "Warning: Filesystem is still mounted. Check for open processes."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "SquashFS filesystem has been unmounted."
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue