#!/bin/bash

while [ true ]; do

	# Sync and get changes.
	changes=$(aws s3 sync --delete "$TICK_S3_URI" /tick | grep -e download -e delete)

	if [[ $? == 0 ]]; then
		echo "Changes: "
		echo "${changes}"
		kill -HUP $(pidof kapacitord)
	else
		echo "No Changes"
	fi

	sleep "15"
done
