From d1244da28435771cc44f3f01f523a0d23221f793 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 2 Dec 2010 22:29:36 -0800 Subject: [PATCH 1/2] script encapsulating sql query that's useful to run (with 'watch') along with discon_ok2.sh --- xwords4/relay/scripts/showinplay.sh | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 xwords4/relay/scripts/showinplay.sh diff --git a/xwords4/relay/scripts/showinplay.sh b/xwords4/relay/scripts/showinplay.sh new file mode 100755 index 000000000..a14216964 --- /dev/null +++ b/xwords4/relay/scripts/showinplay.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e -u + +LIMIT=10000 + +usage() { + echo "usage: $0 [--limit ]" +} + +while [ $# -gt 0 ]; do + case $1 in + --limit) + LIMIT=$2 + shift + ;; + *) usage + ;; + esac + shift +done + +QUERY="WHERE NOT -NTOTAL = sum_array(nperdevice)" + +echo "Row count:" $(psql -t xwgames -c "select count(*) FROM games $QUERY;") + +echo "SELECT dead,connname,cid,room,lang,ntotal,nperdevice,nsent,ctime,mtimes "\ + "FROM games $QUERY ORDER BY NOT dead, connname LIMIT $LIMIT;" \ + | psql xwgames + From 9fd4229384b2f5e71164b3999286df7d52b81b8b Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 2 Dec 2010 22:34:59 -0800 Subject: [PATCH 2/2] pass host to rq too --- xwords4/linux/scripts/discon_ok2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwords4/linux/scripts/discon_ok2.sh b/xwords4/linux/scripts/discon_ok2.sh index b68d30dd6..730593bbe 100755 --- a/xwords4/linux/scripts/discon_ok2.sh +++ b/xwords4/linux/scripts/discon_ok2.sh @@ -153,7 +153,7 @@ kill_from_logs() { done if [ -n "$CMDS" ]; then echo "../relay/rq $CMDS" - ../relay/rq $CMDS 2>/dev/null || true + ../relay/rq -a $HOST $CMDS 2>/dev/null || true fi } @@ -161,7 +161,7 @@ kill_from_log() { LOG=$1 RELAYID=$(./scripts/relayID.sh $LOG) if [ -n "$RELAYID" ]; then - ../relay/rq -d $RELAYID 2>/dev/null || true + ../relay/rq -a $HOST -d $RELAYID 2>/dev/null || true return 0 # success fi return 1