#!/bin/sh
#
# umount all mounted disks
#
# runlevels: geexbox, debug, configure

echo "### Unmounting disks and shares ###"

# umount samba shares
for DIR in /mnt/shares/*/*; do
  test -d "$DIR" && umount "$DIR" >/dev/null 2>&1 && rmdir "$DIR"
done

# release rfcomm connections
killall lircd
[ -x /usr/bin/rfcomm ] && rfcomm release all

exit 0
