#!/bin/bash
### BEGIN BOOT SCRIPT INFO
#Long-Name: PockEmul
### END BOOT SCRIPT INFO
### BEGIN BOOT SCRIPT INSTALLATION DEFAULTS
#Launch-Mode: gui-and-terminal
### END BOOT SCRIPT INSTALLATION DEFAULTS
#
#This script expects a POCKEMUL_OPTS file that sets POCKEMUL_MACHINE to the
#machine name to pass to the --run option.
#
#A patched version of PockEmul that accepts POCKEMUL_HOME as an alternate home
#directory is required.

if [ ! -f POCKEMUL_OPTS ]
then
	echo "No POCKEMUL_OPTS file found." >&2
	exit 1
fi

. ./POCKEMUL_OPTS

if [ ! "$POCKEMUL_MACHINE" ]
then
	echo "POCKEMUL_OPTS did not set POCKEMUL_MACHINE" >&2
	exit 1
fi
POCKEMUL_HOME="$PWD"
export POCKEMUL_HOME
exec Pockemul -g --run="$POCKEMUL_MACHINE"
