#!/bin/sh
if [ $1 ]
then
  DATADIR=$1
else
  DATADIR="$HOME/.gozerbot"
fi
if [ -e $DATADIR ]
then
  cd $DATADIR
else
  mkdir -p $DATADIR
  cd $DATADIR
fi
if [ -e gozerdata/config ]
then
   gozerbot >> gozerbot.log 2>&1 &
else
   gozerinit
   echo "A default config file $DATADIR/gozerdata/config has been created."
   echo "Please edit that file and then run this script again to start gozerbot."
fi
