#!/bin/sh
# Shell script for Nestopia
# Author: Luigi "Reilly" Cozzolino - Jul 2009

# Set some variables:
NESTOPIA_DIR="/usr/share/games/nestopia"
NESTOPIA_BIN="nestopia.bin"

# If `home-gamedir' environment does not exist then create it:
if [ ! -d $HOME/.nestopia ]; then
  mkdir -p $HOME/.nestopia
  ( cd $HOME/.nestopia
    cp -a ${NESTOPIA_DIR}/nstcontrols .
    cp -a ${NESTOPIA_DIR}/NstDatabase.xml .
  )
fi

cd ${NESTOPIA_DIR}
./${NESTOPIA_BIN}
