#!/bin/sh # Simple wrapper for nestopia. NESTOPIA_HOME=$HOME/.nestopia NESTOPIA_DATA=/usr/share/nestopia NESTOPIA_CONTROLS=nstcontrols NESTOPIA_DATABASE=NstDatabase.xml NESTOPIA_BIN=nst # create a place to hold nestopia controls and database if needed if [ ! -d $NESTOPIA_HOME ]; then mkdir $NESTOPIA_HOME; fi; if [ -d $NESTOPIA_HOME ]; then cd $NESTOPIA_HOME; else echo Some error occured when trying to reach $NESTOPIA_HOME; exit; fi; if [ ! -x `which $NESTOPIA_BIN` ]; then echo Could not find nst binary; exit; fi; # copy the packaged nstcontrols if needed if [ ! -e $NESTOPIA_HOME/$NESTOPIA_CONTROLS ]; then cp $NESTOPIA_DATA/$NESTOPIA_CONTROLS $NESTOPIA_CONTROLS; fi; # link to the packaged database if needed if [ ! -e $NESTOPIA_HOME/$NESTOPIA_DATABASE ]; then ln -s $NESTOPIA_DATA/$NESTOPIA_DATABASE $NESTOPIA_DATABASE; fi; $NESTOPIA_BIN $@