integ
This commit is contained in:
49
Run.sh
49
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/
|
||||
@@ -15,26 +41,19 @@ function install() {
|
||||
}
|
||||
|
||||
function enable() {
|
||||
# Warning: ugly hack with sed to allow multiple key instances
|
||||
crudini --set $OUTPUT_DIR/System/$CFG_FILE 'Engine.GameEngine' _ServerPackages IpToCountry_AOL
|
||||
sed -i 's/_ServerPackages/ServerPackages/g' $OUTPUT_DIR/System/$CFG_FILE
|
||||
|
||||
crudini --set $OUTPUT_DIR/System/$CFG_FILE 'Engine.GameEngine' _ServerPackages CountryFlags2
|
||||
sed -i 's/_ServerPackages/ServerPackages/g' $OUTPUT_DIR/System/$CFG_FILE
|
||||
|
||||
crudini --set $OUTPUT_DIR/System/$CFG_FILE 'Engine.GameEngine' _ServerActors ipToCountry.LinkActor
|
||||
sed -i 's/_ServerActors/ServerActors/g' $OUTPUT_DIR/System/$CFG_FILE
|
||||
add_ServerPackage IpToCountry_AOL
|
||||
add_ServerPackage CountryFlags2
|
||||
add_ServerActors ipToCountry.LinkActor
|
||||
|
||||
#todo: set iptocountry service
|
||||
|
||||
echo enable ok
|
||||
}
|
||||
|
||||
function disable() {
|
||||
SSBUFile=$(find $OUTPUT_DIR/System -type f -iname "SmartSB*.u" ! -name "SmartSBStats.u" -exec basename {} \;)
|
||||
SSBBaseName="${SSBUFile%.*}"
|
||||
|
||||
sed -i "/ServerPackages[[:space:]]*=[[:space:]]*IpToCountry_AOL/d" $OUTPUT_DIR/System/$CFG_FILE
|
||||
sed -i "/ServerPackages[[:space:]]*=[[:space:]]*CountryFlags2/d" $OUTPUT_DIR/System/$CFG_FILE
|
||||
sed -i "/ServerActors[[:space:]]*=[[:space:]]*ipToCountry.LinkActor/d" $OUTPUT_DIR/System/$CFG_FILE
|
||||
del_ServerPackage IpToCountry_AOL
|
||||
del_ServerPackage CountryFlags2
|
||||
del_ServerActors ipToCountry.LinkActor
|
||||
|
||||
echo disable ok
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user