#!/bin/bash

if [ "$#" -ne 2 ]; then
	echo "Usage: $0 stop_code freq_secs" >&2
	exit 1
fi

if [ "$2" -lt 3 ]; then
	echo "freq_secs must be larger than or equal to 3" >&2
	exit 1
fi

while true
do
	python "./sbs_client.py" "$1"
	ret=$?
	if [ $ret -ne 0 ]; then
		exit 1
	fi
	sleep $2
done
