#!/bin/sh
# usage: startGS config

PIDFILE=/tmp/GS$USER
GSOUT=/tmp/gs$USER.out
MEDIANET=~/media-net

function usage {
  echo "usage: $0 net-config"
  echo "  where net-config is either Diamond, Line, or Bowtie"
  exit 1
}

if [ $# != 1 ]; then
  usage
fi

rm -f $PIDFILE
cd $MEDIANET/src/mmsched
if [ "$1" = "Diamond" ]; then
  c=7
elif [ "$1" = "Line" ]; then
  c=8
elif [ "$1" = "Bowtie" ]; then
  c=9
else
  usage
fi
  
# ./schedsvr -c $c -e > $GSOUT 2>&1 &
./schedsvr -c $c -h `hostname` -e > $GSOUT 2>&1 &
echo $! > $PIDFILE
