#!/bin/sh
# John Menerick
hosts="62.65.130.180 62.65.130.181"
opts="-p 6543 -U postgres"
tmpdir="$(mktemp -d /tmp/iuaeiueve.XXXXXXXXXXXXXXXX)"
lasthost=""
for host in $hosts; do
psql $opts -h "$host" -l | \
awk 'BEGIN { getline; getline } $2 ~ /\|/ { print $1 }' \
> "$tmpdir/db.$host"
if [ "$lasthost" ]; then
echo "Comparing DBs from $lasthost and $host"
diff -u "$tm..