#!/bin/bash
# $Id: dosrun,v 1.2 2001/12/01 22:25:38 cher Exp $

# just in case...
chmod 755 .

# DOSEMU environment expects file to be named program.exe
mv $1 program.exe

# DOSEMU runs as nobody and has no perms to write to the working dir
> output
> error
> e

# remove write permissions
chmod 555 .

# set path to the dos executable
if [ x"${DOSPATH}" = x ]
then
  echo "DOSPATH environment variable is not set" > error
  echo 100 > e
  exit 100
fi

# Run dosemu
exec ${DOSPATH} -I 'video { none }'

# Something went wrong
echo "exec ${DOSPATH} failed" > error
echo 100 > e
exit 100
