#!/bin/bash
# $Id: dosrun,v 1.3 2003/11/10 06:16:25 cher Exp $
# Copyright (c) 2003 Alexander Chernov

# This script is not actually used.
# For an actual program to start dosemu see ../extra/dosrun3.c.

# 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
