# * starts/stops a client
# * manages when client completes
-if [ ! $# -le 3 ]; then
- echo "usage: $0 client-type torrent-file periods"
+_DEBUG="on"
+
+DEBUG()
+{
+ test ${_DEBUG} = "on" && $@
+}
+
+if test $# -le 3; then
+ echo "usage: $0 client-type torrent-file periods" 1>&2
exit 1
fi
start_client()
{
- echo "starting client ..."
+ DEBUG echo "starting client ..."
}
stop_client()
{
- echo "stopping client ..."
+ DEBUG echo "stopping client ..."
}
suspend_client()
{
- echo "suspending client ..."
+ DEBUG echo "suspending client ..."
}
resume_client()
{
- echo "resuming client ..."
+ DEBUG echo "resuming client ..."
}
+parse_periods
+
+DEBUG echo "start_time is ${start_time}"
+DEBUG echo "suspend_resume is ${suspend_resume[@]}"
+DEBUG echo "stop_time is ${stop_time}"
+
to_sleep=${start_time}
sleep ${to_sleep}
start_client