#!/bin/sh

if [ -z "$LUA_APP_LOCATION" ]; then
	LUA_APP_LOCATION=`pwd`
fi

export LUA_APP_LOCATION

if [ -z "$1" ]; then
	echo "Specify config file"
	exit 1
fi

config=$1
shift

if [ -z "ULIMIT_FILES" ]; then
	ulimit -n $ULIMIT_FILES
fi

exec /usr/bin/env lua5.4		\
	$LUA_APP_LOCATION/core/microdyne.lua	\
	$LUA_APP_LOCATION/core/nepenthes.lua	\
	$config
