Hook scripts are a function of the gphoto2 commandline tool.
You specify them via
--hook-script=script.sh on the commandline with the other commands you supply.
The script will get called on certain events with environment variables set.
ACTION: specifies the action that happened.
ARGUMENT: specifies the argument.
Following actions are getting called:
start: called on startup before any actions happen
download: Requests the download of $ARGUMENT
stop: called after actions happened
self=`basename $0` case "$ACTION" in init) echo "$self: INIT" # exit 1 # non-null exit to make gphoto2 call fail ;; start) echo "$self: START" ;; download) echo "$self: DOWNLOAD to $ARGUMENT" ;; stop) echo "$self: STOP" ;; *) echo "$self: Unknown action: $ACTION" ;; esac exit 0