You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
FILES=/sotw/*
|
|
|
|
USERDIR=$1
|
|
|
|
HACKDIR=$2
|
|
|
|
|
|
|
|
# create initial dir if it does not exist
|
|
|
|
mkdir -p $USERDIR/sotw/
|
|
|
|
|
|
|
|
# link all game files to user dir
|
|
|
|
for f in $FILES
|
|
|
|
do
|
|
|
|
echo "linking $f"
|
|
|
|
ln -s $f $USERDIR/sotw/
|
|
|
|
done
|
|
|
|
|
|
|
|
# remove inital score file
|
|
|
|
rm -rf $USERDIR/sotw/scores.dat
|
|
|
|
# link in shared score file from hackdir
|
|
|
|
ln -s $HACKDIR/scores.dat $USERDIR/sotw/
|
|
|
|
|
|
|
|
## remove initial config file
|
|
|
|
rm -rf $USERDIR/sotw/swyrm.ini
|
|
|
|
## copy in sotw config file
|
|
|
|
cp /sotw/swyrm.ini $USERDIR/sotw/swyrm.ini
|
|
|
|
|
|
|
|
# sed find and replace swyrm.ini to set users dir
|
|
|
|
sed -i "s:userdata_dir=:userdata_dir=${USERDIR}/sotw/:g" $USERDIR/sotw/swyrm.ini
|