#!/bin/bash
if [ ! -f "$1" ]; then
  echo "error: must specify rooms file"
  exit 1
fi
NUM=0
if [ ! -z "$2" ]; then
  HOSTS="$2"
else
  HOSTS="`cat \"$1\"`"
fi
for HOST in $HOSTS; do
  >&2 echo starting up host $HOST
  ssh pi@$HOST "screen -dm bash stream.sh"
  NUM=$((NUM+1))
done
