1+ #! /bin/bash
2+
3+ # --- Configuration ---
4+ # Path to your UE5 Dedicated Server executable
5+ UE5_SERVER_PATH=" /path/to/YourProject/Binaries/Linux/YourProjectServer"
6+ # Example: /home/user/UnrealEngine/YourProject/Binaries/Linux/YourProjectServer
7+
8+ NODE_VERSION=" lts"
9+
10+ # Arguments to pass to the UE5 Dedicated Server
11+ UE5_SERVER_ARGS=" -log -port=7777"
12+ # Example: -log -port=7777 -QueryPort=27015
13+
14+ # Check if Node.js is installed
15+ if ! command -v node & > /dev/null
16+ then
17+ echo " Node.js not found. Installing Node.js using NVM..."
18+
19+ # Install NVM
20+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
21+
22+ # Source NVM to make it available in the current shell
23+ export NVM_DIR=" $HOME /.nvm"
24+ [ -s " $NVM_DIR /nvm.sh" ] && \. " $NVM_DIR /nvm.sh" # This loads nvm
25+ [ -s " $NVM_DIR /bash_completion" ] && \. " $NVM_DIR /bash_completion" # This loads nvm bash_completion
26+
27+ # Install the latest LTS version of Node.js
28+ nvm install --" $NODE_VERSION "
29+
30+ # Set the installed LTS version as default
31+ nvm alias default " $NODE_VERSION " /*
32+
33+ echo " Node.js installation complete."
34+ else
35+ echo " Node.js is already installed."
36+ fi
37+
38+ # --- Launching UE5 Dedicated Server ---
39+
40+ echo " Launching UE5 Dedicated Server..."
41+
42+ if [ -f " $UE5_SERVER_PATH " ]; then
43+ " $UE5_SERVER_PATH " " $UE5_SERVER_ARGS "
44+ else
45+ echo " Error: UE5 Dedicated Server executable not found at $UE5_SERVER_PATH "
46+ exit 1
47+ fi
48+
49+ echo " UE5 Dedicated Server launched."
0 commit comments