Sophie

Sophie

distrib > Mandriva > cooker > x86_64 > by-pkgid > 3746eacfd303f5e29a5b39625ad37a41 > files > 3

nestopia-1.40h-2.src.rpm

#!/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 $@