#!/bin/bash

INTERVAL="10"

while true; do
	uploads="$(find "$(dirname "$0")/images/0-CURRENT/upload" -maxdepth 1 -type f -name '*.jpg')"
	if [ "$uploads" != "" ]; then
		scp $uploads root@10.17.0.2:/root/monitor/images && rm -f $uploads
	fi
	sleep $INTERVAL
done
