#!/bin/bash let x=1 while [ 1 ]; do wget "http://<ip adress>/snapshot.cgi?user=<username>&pwd=<password>" -O $(printf %04d.jpg ${x%.*}) let x++ done