Added: kill open shell to allow unmounting of array

This commit is contained in:
bergware
2018-01-04 16:55:38 +01:00
parent 24e0a9e47d
commit 0ab2ba263e

View File

@@ -0,0 +1,5 @@
#!/bin/bash
# kill any open shell which prevents unmounting of array
for PID in $(lsof /mnt/disk[0-9]* /mnt/cache /mnt/user /mnt/user0 2>/dev/null|grep -vP '^(lsof|grep|awk|COMMAND)'|awk '{print $2}'); do
kill -9 $PID 1>/dev/null 2>&1
done