Skip to content

Commit

Permalink
Merge pull request #6 from macreiben-dev/feature/unable_to_launch_server
Browse files Browse the repository at this point in the history
Feature/unable to launch server
  • Loading branch information
macreiben-dev authored Jan 17, 2024
2 parents 77c6130 + c1f8eb0 commit 4556e18
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
17 changes: 4 additions & 13 deletions src/buildimage/adminScripts/admin_patch_serverPort.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,13 @@ fi

# Check if the variable is set
if [ -n "$http_server_port" ] && [ -n "$simulation_port" ] ; then

# Clean previously generated files
rm /server/UserData/player/*.tmp

# Create a backup of the original file
cp "$json_file" "${json_file}.tmp"

# Update the JSON file using jq
jq --argjson new_port "$http_server_port" '.["Multiplayer General Options"]["HTTP Server Port"]=$new_port' "${json_file}.tmp" > "${json_file}_001.tmp"
jq --argjson new_port "$simulation_port" '.["Multiplayer General Options"]["Simulation Port"]=$new_port' "${json_file}_001.tmp" > "${json_file}_002.tmp"

# Replace configuration
mv "${json_file}_002.tmp" "${json_file}"
# Update the JSON configuration file
sed -i 's/\("Simulation Port":\)[0-9]\+/\1'"$simulation_port"'/' "${json_file}"
sed -i 's/\("HTTP Server Port":\)[0-9]\+/\1'"$http_server_port"'/' "${json_file}"

echo "HTTP Server Port updated to $http_server_port in $json_file"
echo "Simulation Port updated to $simulation_port in $json_file"
else
echo "HTTP_SERVER_PORT environment variable is not set."
echo "HTTP_SERVER_PORT or SIMULATION_PORT environment variable is not set."
fi
2 changes: 1 addition & 1 deletion src/buildimage/adminScripts/admin_start_mas2.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd /server

wine /server/Support/Tools/MAS2.exe
WINEDEBUG=-debug wine /server/Support/Tools/MAS2.exe
3 changes: 2 additions & 1 deletion src/buildimage/adminScripts/admin_start_modMgr.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cd /server
wine /server/Bin64/ModMgr.exe

WINEDEBUG=-debug wine /server/Bin64/ModMgr.exe
2 changes: 1 addition & 1 deletion src/buildimage/adminScripts/admin_start_server.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd /server

wine /server/Bin64/rFactor2\ Dedicated.exe
WINEDEBUG=-debug wine /server/Bin64/rFactor2\ Dedicated.exe

0 comments on commit 4556e18

Please sign in to comment.