Automatically unmount external drives when shutting down OSX?
There are few apps that can eject the external drive as described here:

Automatically eject external disks on sleep and reconnect after on OS X

Jettison app $4.99

autoEJECT app $4.99

just to name 2.