-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
stub.sh
executable file
·45 lines (36 loc) · 1.16 KB
/
stub.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
executable=$1
if [ -z "$executable" ]
then
#Stub all FastDoom executables
parameter="stub.bat"
else
#Stub only one executable
parameter="stub.bat $executable"
fi
echo "FastDoom DOS32/A Stub script"
echo -n > STUB.LOG
tail -F STUB.LOG &
tail_pid=$!
# Try native apps
if type dosbox-x &>/dev/null; then
echo "Using native DOSBox-X"
dosbox-x -fastlaunch -silent -nomenu -nogui -noautoexec -noconfig -c "config -set cycles=max" -c "mount J ." -c "J:" -c "SET DOS32A=J:\DOS32A" -c "SET PATH=%PATH%;J:\DOS32A\BINW" -c "$parameter" &>/dev/null
kill -TERM $tail_pid
rm STUB.LOG
echo "Done"
exit
fi
echo "Native DOSBox-X not found"
# Try flatpak app
if flatpak info com.dosbox_x.DOSBox-X > /dev/null 2>&1; then
echo "Using Flatpak DOSBox-X"
flatpak run com.dosbox_x.DOSBox-X -fastlaunch -silent -nomenu -nogui -noautoexec -noconfig -c "config -set cycles=max" -c "mount J ." -c "J:" -c "SET DOS32A=J:\DOS32A" -c "SET PATH=%PATH%;J:\DOS32A\BINW" -c "$parameter" &>/dev/null
kill -TERM $tail_pid
rm STUB.LOG
echo "Done"
exit
fi
echo "Flatpak DOSBox-X not found"
echo "No suitable DOSBox-X installation found. Abort"