@@ -69,6 +69,27 @@ private function addCoreService()
6969
7070 private function addCoreOptions ()
7171 {
72+ $ script = <<<'EOF'
73+ #!/bin/bash
74+ # SRCDS Base Installation Script
75+ #
76+ # Server Files: /mnt/server
77+ apt update
78+ apt install curl
79+
80+ cd /tmp
81+ curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz
82+
83+ mkdir /mnt/server/steamcmd
84+ tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
85+ cd /mnt/server/steamcmd
86+
87+ ./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update ${SRCDS_APPID} +quit
88+
89+ mkdir -p /mnt/server/.steam/sdk32
90+ cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
91+ EOF;
92+
7293 $ this ->option ['source ' ] = ServiceOption::updateOrCreate ([
7394 'service_id ' => $ this ->service ->id ,
7495 'tag ' => 'source ' ,
@@ -82,6 +103,9 @@ private function addCoreOptions()
82103 'config_stop ' => 'quit ' ,
83104 'config_from ' => null ,
84105 'startup ' => null ,
106+ 'script_install ' => $ script ,
107+ 'script_entry ' => 'bash ' ,
108+ 'script_container ' => 'ubuntu:16.04 ' ,
85109 ]);
86110
87111 $ this ->option ['insurgency ' ] = ServiceOption::updateOrCreate ([
@@ -97,6 +121,7 @@ private function addCoreOptions()
97121 'config_stop ' => null ,
98122 'config_from ' => $ this ->option ['source ' ]->id ,
99123 'startup ' => './srcds_run -game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart ' ,
124+ 'copy_script_from ' => $ this ->option ['source ' ]->id ,
100125 ]);
101126
102127 $ this ->option ['tf2 ' ] = ServiceOption::updateOrCreate ([
@@ -112,8 +137,34 @@ private function addCoreOptions()
112137 'config_stop ' => null ,
113138 'config_from ' => $ this ->option ['source ' ]->id ,
114139 'startup ' => './srcds_run -game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart ' ,
140+ 'copy_script_from ' => $ this ->option ['source ' ]->id ,
115141 ]);
116142
143+ $ script = <<<'EOF'
144+ #!/bin/bash
145+ # ARK: Installation Script
146+ #
147+ # Server Files: /mnt/server
148+ apt update
149+ apt install curl
150+
151+ cd /tmp
152+ curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz
153+
154+ mkdir /mnt/server/steamcmd
155+ mkdir -p /mnt/server/Engine/Binaries/ThirdParty/SteamCMD/Linux
156+
157+ tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
158+ tar -xzvf steamcmd.tar.gz -C /mnt/server/Engine/Binaries/ThirdParty/SteamCMD/Linux
159+
160+ cd /mnt/server/steamcmd
161+
162+ ./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 376030 +quit
163+
164+ mkdir -p /mnt/server/.steam/sdk32
165+ cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
166+ EOF;
167+
117168 $ this ->option ['ark ' ] = ServiceOption::updateOrCreate ([
118169 'service_id ' => $ this ->service ->id ,
119170 'tag ' => 'ark ' ,
@@ -127,6 +178,9 @@ private function addCoreOptions()
127178 'config_stop ' => '^C ' ,
128179 'config_from ' => $ this ->option ['source ' ]->id ,
129180 'startup ' => './ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}} ' ,
181+ 'script_install ' => $ script ,
182+ 'script_entry ' => 'bash ' ,
183+ 'script_container ' => 'ubuntu:16.04 ' ,
130184 ]);
131185 }
132186
0 commit comments