Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
#!/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