From df61d29d77e2eb71c53ee36adff2ff983128e008 Mon Sep 17 00:00:00 2001 From: chacha Date: Sat, 14 May 2022 11:27:13 +0200 Subject: [PATCH] integ --- Run.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Run.sh b/Run.sh index 161ff01..ae4aaf7 100755 --- a/Run.sh +++ b/Run.sh @@ -5,6 +5,32 @@ OUTPUT_DIR="$2" CFG_FILE="$3" DEFAULT_CFG_FILE=UnrealTournament.ini +function add_iniKey() { + crudini --set $OUTPUT_DIR/System/$CFG_FILE $1 __$2 $3 + # Warning: ugly hack with sed to allow multiple key instances + to remove space around '=' + sed -i "s/[[:space:]]*__$2[[:space:]]*=[[:space:]]*/$2=/g" $OUTPUT_DIR/System/$CFG_FILE +} + +# !!Warning!! section is not considered +function del_iniKey() { + sed -i "/[[:space:]]*$2[[:space:]]*=[[:space:]]*$3/d" $OUTPUT_DIR/System/$CFG_FILE +} + +function add_ServerPackage() { + add_iniKey 'Engine.GameEngine' ServerPackages $1 +} + +function del_ServerPackage() { + del_iniKey 'Engine.GameEngine' ServerPackages $1 +} + +function add_ServerActors() { + add_iniKey 'Engine.GameEngine' ServerActors $1 +} + +function del_ServerActors() { + del_iniKey 'Engine.GameEngine' ServerActors $1 +} function install() { rsync -a $SCRIPT_DIR/Help/ $OUTPUT_DIR/Help/ @@ -14,6 +40,7 @@ function install() { } function enable() { + #todo: setup serverpackages echo enable ok }