#!/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