summarylogtreecommitdiffstats
path: root/mutantfactions-server
blob: b38b02ee957941a4a58450d907744ef677d4c942 (plain)
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
#! /bin/sh

source /etc/conf.d/mutantfactions

USER=$(id -un)
if [[ $USER != "mutantfactions" ]]; then
  echo "This program should only be run by the mutantfactions user"
  exit
fi

cleanup()
{
  fusermount -u $HOME/.mutantfactions/overlay
}

if [[ ! -d $HOME/.mutantfactions/overlay ]]; then
  mkdir -p $HOME/.mutantfactions/overlay
fi
if [[ ! -d $HOME/.mutantfactions/data ]]; then
  mkdir -p $HOME/.mutantfactions/data
fi

unionfs -o cow $HOME/.mutantfactions/data=RW:/opt/mutantfactions=RO $HOME/.mutantfactions/overlay
trap cleanup SIGINT
$HOME/.mutantfactions/overlay/MutantFactionsServer $MUTANT_FACTIONS_ARGS