Merge pull request #8413 from moviuro/better-launch-scripts

launch-dedicated.sh: Support passing args from CLI
This commit is contained in:
Matthias Mailänder
2015-06-19 07:23:38 +02:00

View File

@@ -1,15 +1,22 @@
#!/bin/sh #!/bin/sh
# example launch script, see https://github.com/OpenRA/OpenRA/wiki/Dedicated for details # example launch script, see https://github.com/OpenRA/OpenRA/wiki/Dedicated for details
Name="Dedicated Server"
Mod="ra" # Usage:
# $ ./launch-dedicated.sh # Launch a dedicated server with default settings
# $ Mod="d2k" ./launch-dedicated.sh # Launch a dedicated server with default settings but override the Mod
# Read the file to see which settings you can override
Name="${Name:-"Dedicated Server"}"
Mod="${Mod:-"ra"}"
Dedicated="True" Dedicated="True"
DedicatedLoop="True" DedicatedLoop="True"
ListenPort=1234 ListenPort="${ListenPort:-"1234"}"
ExternalPort=1234 ExternalPort="${ExternalPort:-"1234"}"
AdvertiseOnline="False" AdvertiseOnline="${AdvertiseOnline:-"True"}"
AllowPortForward="${AllowPortForward:-"False"}"
while true; do while true; do
mono --debug OpenRA.Game.exe Game.Mod=$Mod Server.Dedicated=$Dedicated Server.DedicatedLoop=$DedicatedLoop \ mono --debug OpenRA.Game.exe Game.Mod=$Mod Server.Dedicated=$Dedicated Server.DedicatedLoop=$DedicatedLoop \
Server.Name="$Name" Server.ListenPort=$ListenPort Server.ExternalPort=$ExternalPort \ Server.Name="$Name" Server.ListenPort=$ListenPort Server.ExternalPort=$ExternalPort \
Server.AdvertiseOnline=$AdvertiseOnline Server.AdvertiseOnline=$AdvertiseOnline Server.AllowPortForward=$AllowPortForward
done done