Last active
December 5, 2015 15:02
-
-
Save Hello71/b84f3c4138b8ef68ad55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run this script at boot somehow then run .exes directly. | |
# Requires "file" utility at least version 4.18 (released 2006-10-31) | |
# Uncomment the following line and adjust as necessary if necessary. | |
# iam="$HOME/bin/exe" | |
if [ "$#" = 0 ]; then | |
if ! [ -f "$iam" ]; then | |
iam="${BASH_SOURCE}" | |
if ! [ -f "$iam" ]; then | |
iam="$(readlink "$0")" | |
if ! [ -f "$iam" ]; then | |
iam="/usr/local/bin/exe" | |
if ! [ -f "$iam" ]; then | |
echo "fatal: could not determine script location." >&2 | |
echo "install \"exe.sh\" as $iam or modify \$iam in the script." >&2 | |
exit 1 | |
fi | |
fi | |
fi | |
fi | |
printf ':EXE:M::MZ::%s:\n' "$iam" > /proc/sys/fs/binfmt_misc/register | |
else | |
case "$(file -b -e apptype -e ascii -e cdf -e compress -e elf -e encoding -e tar -e text -e tokens "$1")" in | |
*"Mono/.Net"*) exec mono "$@";; | |
*) exec wine "$@";; | |
esac | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment