Now the shell script runs whenever any volume is mounted. But what happens to stdout & stderr when the script is triggered by automator? Well - it vanishes, so you need to redirect it somewhere useful. Early on in my script I redirect stdout and stderr to a log file:
exec > ~/Library/Logs/mount-event.out 2>&1
The script will not receive any incoming content or variables and the current working directory will be they users' home, so you just need to start from scratch.