diff --git a/Run.sh b/Run.sh index 67a0222..12805f7 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