beforesleep.sh
#!/bin/sh osascript -e 'tell application "Finder" to eject (disks where free space ≠ 0)'
afterwake.sh
#!/bin/sh /usr/sbin/diskutil list | grep -e ' \+[0-9]\+: \+[^ ]\+ [^ ]\+' | sed 's/.*\(disk[0-9].*\)/\1/' | xargs -I{} /usr/sbin/diskutil mount {}