Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
arch-gog/gog-dosbox-launcher/gog-dosbox-launcher
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
36 lines (31 sloc)
846 Bytes
This file contains 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 | |
| GOGNAME=$1 | |
| CONFIG=$2 | |
| UNIONDIR=`mktemp -d` | |
| RWDIR=$HOME/.gog/$GOGNAME | |
| BASEDIR=/opt/gog/$GOGNAME/base | |
| DOSBOXDIR=/opt/gog/$GOGNAME/dosbox | |
| if [ ! -d $RWDIR ]; then | |
| mkdir -p $RWDIR | |
| echo "Local storage directory created at $RWDIR" | |
| echo "Starting unionfs" | |
| else | |
| echo "Local storage already exists, starting unionfs" | |
| fi | |
| unionfs -o cow -o uid=$UID ${RWDIR}=RW:${DOSBOXDIR}=RO:${BASEDIR}=RO $UNIONDIR | |
| echo "unionfs mounted at $UNIONDIR" | |
| cd $UNIONDIR | |
| echo "Launching game..." | |
| dosbox -conf $CONFIG | |
| echo "Waiting for game to finish..." | |
| cd | |
| sleep 1 | |
| fusermount -u $UNIONDIR | |
| rmdir $UNIONDIR | |
| if [ ! -d $UNIONDIR ]; then | |
| echo "unionfs unmounted; $UNIONDIR removed" | |
| echo "Done. Quitting." | |
| else | |
| echo "unionfs didn't unmount, something went wrong" | |
| echo "rescue your savegames from $UNIONDIR and report a bug" | |
| fi |