mirror of
https://github.com/SWG-Source/swg-main.git
synced 2026-01-15 19:04:18 -05:00
Download server settings from a web service before startup
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ miff/
|
||||
.setup
|
||||
local.properties
|
||||
*.log
|
||||
webcfg.properties
|
||||
|
||||
13
build.xml
13
build.xml
@@ -470,7 +470,18 @@
|
||||
<symlink link="${basedir}/exe/linux/bin" resource="${tools_home}" overwrite="true"/>
|
||||
</target>
|
||||
|
||||
<target name="start" description="starts the server" depends="create_symlinks,stop">
|
||||
<target name="webcfg-check-for-file">
|
||||
<available file="webcfg.properties" property="webcfg.properties.present"/>
|
||||
</target>
|
||||
|
||||
<target name="webcfg" description="Fetches the settings using the SWG Auth WebCFG API" depends="webcfg-check-for-file" if="webcfg.properties.present">
|
||||
<property file="webcfg.properties" />
|
||||
<echo message="Server path: ${serverpath}" />
|
||||
<echo message="File Path: ${filepath}" />
|
||||
<get src="${serverpath}" dest="${filepath}" />
|
||||
</target>
|
||||
|
||||
<target name="start" description="starts the server" depends="create_symlinks,stop,webcfg">
|
||||
<exec executable="bin/TaskManager" dir="${exe}/linux" spawn="true">
|
||||
<arg value="--"/>
|
||||
<arg value="@servercommon.cfg"/>
|
||||
|
||||
@@ -20,6 +20,13 @@ killall SwgDatabaseServer &> /dev/null
|
||||
killall SwgGameServer &> /dev/null
|
||||
killall TransferServer &> /dev/null
|
||||
|
||||
if [[ -f webcfg.properties ]]; then
|
||||
echo "Fetching your settings using the SWG Auth WebCFG API"
|
||||
SERVERPATH=$(cat webcfg.properties | grep serverpath | sed 's/^.*= //')
|
||||
FILEPATH=$(cat webcfg.properties | grep filepath | sed 's/^.*= //')
|
||||
wget $SERVERPATH -O $FILEPATH
|
||||
fi
|
||||
|
||||
./bin/LoginServer -- @servercommon.cfg &
|
||||
|
||||
sleep 5
|
||||
|
||||
Reference in New Issue
Block a user