Created
February 28, 2016 04:04
-
-
Save yamano/328b3a94ff802bd179cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CMD="curl http://192.168.1.1/osc/commands/execute -s -H \"Accept: application/json\" -H \"Content-type: application/json;charset=utf-8\" -X POST -d" | |
SID=`${CMD} '{"name":"camera.startSession"}'| sed -E "s/^.*\"sessionId\":\"([^\"]*)\".*$/\1/"` | |
${CMD} "{\"name\": \"camera.takePicture\", \"parameters\": {\"sessionId\": \"${SID}\"}}" | |
FURI=`curl -X POST http://192.168.1.1/osc/state | sed -E "s/^.*\"_latestFileUri\":\"([^\"]*)\".*$/\1/"` | |
echo ${FURI} | sed "s/\//_/" > filename | |
cat filename | |
FILENAME=`cat filename` | |
${CMD} "{\"name\": \"camera.getImage\", \"parameters\": {\"fileUri\": \"${FURI}\"}}" > ${FILENAME} | |
${CMD} "{\"name\":\"camera.closeSession\",\"parameters\":{\"sessionId\":\"${SID}\"}}" | |
open ${FILENAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment