modifying ini file from setup script

This commit is contained in:
Enno Rehling 2014-08-12 22:00:26 +02:00
parent ca64be7868
commit 6fbb9b46ca
2 changed files with 20 additions and 10 deletions

@ -1 +1 @@
Subproject commit 537ba2f174d51cb06c3a97a1a0285b384b0e3d1a Subproject commit 699b35b22b35cf96072483d409458f45bbf6227e

28
s/setup
View File

@ -18,12 +18,20 @@ Usage: $u [-hf] [-d DIR] [-g <game>] [-r <rules>] [-s DIR]
USAGE USAGE
} }
function ini_section() {
$SOURCE/bin/inifile eressea.ini add $1
}
function ini_add() {
$SOURCE/bin/inifile eressea.ini add $1 $2
}
game=0 game=0
force=0 force=0
src=server src=server
while getopts :d:g:r:s:hf o; do while getopts :d:g:r:s:hf o; do
case "${o}" in case "${o}" in
h) usage ;; h) usage ; exit 0 ;;
s) src=${OPTARG} ;; s) src=${OPTARG} ;;
d) dir=${OPTARG} ;; d) dir=${OPTARG} ;;
f) force=1 ;; f) force=1 ;;
@ -33,6 +41,7 @@ while getopts :d:g:r:s:hf o; do
esac esac
done done
[ $game -gt 0 ] || abort "must use a positive integer for game id"
[ -d $ERESSEA ] || abort "invalid or missing env variable ERESSEA ($ERESSEA)" [ -d $ERESSEA ] || abort "invalid or missing env variable ERESSEA ($ERESSEA)"
[ -z $SOURCE ] && SOURCE=$ERESSEA/$src [ -z $SOURCE ] && SOURCE=$ERESSEA/$src
[ -d $SOURCE ] || abort "invalid source directory $SOURCE" [ -d $SOURCE ] || abort "invalid source directory $SOURCE"
@ -46,13 +55,14 @@ fi
mkdir -p $dir mkdir -p $dir
cd $dir || abort "could not chdir to game-$game" cd $dir || abort "could not chdir to game-$game"
mkdir -p data reports mkdir -p data reports
cat > eressea.ini <<ERESSEAINI
[eressea]
locales = de,en
[lua] touch eressea.ini
install=$SOURCE ini_section eressea
paths=$SOURCE/scripts:$SOURCE/lunit ini_add eressea:locales de,en
rules = $rules ini_section lua
ERESSEAINI ini_add lua:install $SOURCE
ini_add lua:install $SOURCE
ini_add lua:paths $SOURCE/scripts:$SOURCE/lunit
ini_add lua:rules $rules
ln -f $SOURCE/scripts/run-turn.lua ln -f $SOURCE/scripts/run-turn.lua