Run a command in terminal/iterm2 when an encrypted usb partition is mounted
Im not certain it will work for this, but I would suggest looking into AppleScript. I know you can use it to run Terminal commands, but I don't know if there is a way to detect when A flash drive is mounted.