diff options
author | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:54:38 +0530 |
---|---|---|
committer | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:54:38 +0530 |
commit | 6a16bbdcdb40406592e47ee8d489f857837e5c96 (patch) | |
tree | 8d1a9f72115a106657e059f56e5b47df1a92f483 /scripts/automount-clean |
Initial commit
Diffstat (limited to 'scripts/automount-clean')
-rwxr-xr-x | scripts/automount-clean | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/automount-clean b/scripts/automount-clean new file mode 100755 index 0000000..eff3cc9 --- /dev/null +++ b/scripts/automount-clean @@ -0,0 +1,9 @@ +#!/bin/sh + +while sleep 10; do + find "/media/$USER" -mindepth 1 -maxdepth 1 -printf "%P\n" | while read -r mount; do + [ -n "$(lsblk | grep -F "$mount")" ] && continue + sudo fusermount -u "/media/$USER/$mount" + rmdir -v "/media/$USER/$mount" + done +done |