linuxOS_AP06/debian/scripts/unmount.sh
2025-06-03 12:28:32 +08:00

17 lines
309 B
Bash
Executable File

#!/bin/bash -e
SCRIPTS_DIR=$(realpath $(dirname $0))
DEBIAN_DIR=$(realpath $SCRIPTS_DIR/..)
WORK_DIR=$(realpath $DEBIAN_DIR/work)
main(){
while mount | grep -q $WORK_DIR; do
local LOCS
LOCS=$(mount | grep $WORK_DIR | cut -f 3 -d ' ' | sort -r)
for loc in $LOCS; do
sudo umount "$loc"
done
done
}
main