You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
462 B

#!/bin/bash
DBNAME=mam-prod
F1="$1"
F2="$2"
TMPF1=`tempfile`
TMPF2=`tempfile`
if which colordiff; then
DIFF=colordiff
else
DIFF=diff
fi
if [ "z$F1" == "z" ]; then
echo "Requies argument"
exit 1
fi
cat "$F1" | bunzip2 > "$TMPF1"
if [ "z$F2" == "z" ]; then
echo "Diff from $F1 to current DB:"
pg_dump $DBNAME -U mam >"$TMPF2"
else
echo "Diff from $F1 to $F2:"
cat "$F2" | bunzip2 > "$TMPF2"
fi
$DIFF "$TMPF1" "$TMPF2"
rm "$TMPF1" "$TMPF2"