xwords/xwords4/relay/scripts/showinplay.sh
Eric House 866aeb2387 change relay connect message format to include client version (meaning
of which is TBD).  When a new-version client connects, store the value
it's passed. At first this will let me track how quickly people
upgrade.  Later I can use it to let different clients have different
formats to their messages e.g. to proxy.
2012-01-26 05:43:54 -08:00

32 lines
632 B
Bash
Executable file

#!/bin/sh
set -e -u
LIMIT=10000
usage() {
echo "usage: $0 [--limit <n>]"
exit 1
}
while [ $# -gt 0 ]; do
case $1 in
--limit)
LIMIT=$2
shift
;;
*) usage
;;
esac
shift
done
QUERY="WHERE NOT -NTOTAL = sum_array(nperdevice)"
echo "Device (pid) count: $(pidof xwords | wc | awk '{print $2}')"
echo "Row count:" $(psql -t xwgames -c "select count(*) FROM games $QUERY;")
echo "SELECT dead,connname,cid,room,lang,ntotal,clntVers,nperdevice,seeds,ack,nsent "\
"FROM games $QUERY ORDER BY NOT dead, connname LIMIT $LIMIT;" \
| psql xwgames