#!/bin/bash SERVER=3Dprinter PORT=8080 EXT=.jpg NAME=$1 if [ "$NAME" == "" ]; then NAME=`date +%Y%m%d-%H%M`; fi for x in "" `seq 1 100`; do if [ "$x" ]; then x="-$x"; fi if [ -f "$NAME$x$EXT" ]; then continue; fi NAME=$NAME$x break done curl -s "http://$SERVER:$PORT/?action=snapshot" > $NAME$EXT file $NAME$EXT identify $NAME$EXT