dlna-utils/dlna_unbind_all.sh
2024-12-29 00:14:21 +03:00

20 lines
297 B
Bash
Executable File

#!/bin/sh
set -e
bind_root="/media/minidlnad"
if [ -z "$(ls $bind_root)" ]; then
>&2 echo "directory $bind_root is empty"
exit
fi
for f in $bind_root/*; do
if umount "$bind_root/$(basename "$f")"; then
rm "$bind_root/$(basename "$f")"
echo "[ OK ] $f"
else
echo "[FAIL] $f"
fi
done