A small shell script to be used with binfmt_misc to start either dosbox or wine, depending on the output of the file command.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
696 B

#!/bin/sh
#
# This is a first very simple script to identify a given M$ executable
# and launch it with the correct interpreter, either Dosbox or Wine so far.
#
# Author: Georg Hopp <georg@steffers.org>
# Changelog:
# 2017-02-07 Start work on this
#
function get_interpreter() {
local EXE="$1"
echo "$(basename "${EXE}")" >&2
case "$(file -b "${EXE}")" in
*DOS*)
local CONFIG="${HOME}/.dosbox/$(basename "${EXE}").conf"
if [ ! \( -e "${CONFIG}" \) ]
then
cp "${HOME}/.dosbox/dosbox-SVN.conf" "${CONFIG}"
fi
echo -n "/usr/bin/dosbox -exit -conf ${CONFIG}"
;;
*Windows*) echo -n "/usr/bin/wine";;
esac
}
exec $(get_interpreter "$1") "$@"
# vim: ft=sh ts=4 sw=4: