forked from ermo/privateer_wcu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
play_vs
41 lines (34 loc) · 1.06 KB
/
play_vs
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
#!/bin/sh
ARG=$1
SETUPARG=${ARG:="nosetup"}
CURPWD=$PWD
DATAFOLDER="data4.x"
#Now search for the data directory in supported directories.
VSDATADIR=0
for TEMPDATADIR in $CURPWD $CURPWD/$DATAFOLDER $CURPWD/../$DATAFOLDER /usr/local/games/vegastrike/$DATAFOLDER /usr/share/local/vegastrike/$DATAFOLDER /usr/local/share/vegastrike/$DATAFOLDER /usr/share/vegastrike/$DATAFOLDER /usr/games/vegastrike/$DATAFOLDER /opt/share/vegastrike/$DATAFOLDER /usr/local/vegastrike/$DATAFOLDER ; do
{
if [ -s $TEMPDATADIR/factions.xml ]; then
VSDATADIR=$TEMPDATADIR
echo Got data $VSDATADIR
break
fi
} ; done
if [ $VSDATADIR != 0 ]; then
VERSION=`head -1 $VSDATADIR/Version.txt`
mkdir -p $HOME/$VERSION
cd $HOME/$VERSION
if [ \! -e ~/$VERSION/setup.config ]; then
cp $VSDATADIR/setup.config .
fi
if [ \! -e ~/$VERSION/vegastrike.config ]; then
cp $VSDATADIR/vegastrike.config .
vssetup
fi
if [ $SETUPARG = "setup" ] || [ $SETUPARG = "--setup" ]; then
vssetup
fi
cd $VSDATADIR
vslauncher
else
echo A data directory cannot be found.
fi