From 6fbb9b46ca21753635af0c577cbcc88b17bc6612 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 12 Aug 2014 22:00:26 +0200 Subject: [PATCH] modifying ini file from setup script --- iniparser | 2 +- s/setup | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/iniparser b/iniparser index 537ba2f17..699b35b22 160000 --- a/iniparser +++ b/iniparser @@ -1 +1 @@ -Subproject commit 537ba2f174d51cb06c3a97a1a0285b384b0e3d1a +Subproject commit 699b35b22b35cf96072483d409458f45bbf6227e diff --git a/s/setup b/s/setup index 55b26b048..e9449e23b 100755 --- a/s/setup +++ b/s/setup @@ -18,12 +18,20 @@ Usage: $u [-hf] [-d DIR] [-g ] [-r ] [-s DIR] USAGE } +function ini_section() { +$SOURCE/bin/inifile eressea.ini add $1 +} + +function ini_add() { +$SOURCE/bin/inifile eressea.ini add $1 $2 +} + game=0 force=0 src=server while getopts :d:g:r:s:hf o; do case "${o}" in - h) usage ;; + h) usage ; exit 0 ;; s) src=${OPTARG} ;; d) dir=${OPTARG} ;; f) force=1 ;; @@ -33,6 +41,7 @@ while getopts :d:g:r:s:hf o; do esac done +[ $game -gt 0 ] || abort "must use a positive integer for game id" [ -d $ERESSEA ] || abort "invalid or missing env variable ERESSEA ($ERESSEA)" [ -z $SOURCE ] && SOURCE=$ERESSEA/$src [ -d $SOURCE ] || abort "invalid source directory $SOURCE" @@ -46,13 +55,14 @@ fi mkdir -p $dir cd $dir || abort "could not chdir to game-$game" mkdir -p data reports -cat > eressea.ini <