#!/bin/sh
# pdbget script for mustang that fetches
# db entries to run test file.
#
set -e

SERVER=www.pdb.org
entries="1sp1 1sp2 3znf"

pdb_fetch () {
  for n in $* ; do
      wget -nv http://${SERVER}/pdb/files/$n.pdb.gz
  done
}

# The process will run in this directory:
tmpdir=/tmp/mustang

savedir=$PWD
rm -rf $tmpdir
mkdir -p $tmpdir
cd $tmpdir
pdb_fetch $entries
for f in $entries; do gzip -dc $f.pdb.gz > $f.pdb ; done

mustang -f /usr/share/doc/mustang/examples/test_zf-CCHH-small
cd $savedir

echo Results are in $tmpdir/results.html and $tmpdir/results.pdb
