Compare commits

..

71 Commits

Author SHA1 Message Date
b6bd0bfd3e Dockerfile aktualisiert 2024-04-19 09:33:41 +02:00
a251a00e5a Dateien nach "scripts" hochladen 2024-04-19 09:32:24 +02:00
6081948728 scripts/start-server.sh aktualisiert 2024-04-19 09:26:32 +02:00
8ddea4eb38 Dockerfile aktualisiert 2024-04-19 09:24:08 +02:00
35546570da Dateien nach "scripts" hochladen 2024-04-19 09:21:10 +02:00
d3ac6481c9 config/ServerConfig_.ini gelöscht 2023-10-24 17:02:29 +02:00
d8445bcc49 Dateien nach "config" hochladen 2023-10-24 17:02:19 +02:00
713a899b2c Update scripts/start-server.sh 2023-07-13 08:29:20 +02:00
05f20eac1e Update scripts/start-server.sh 2023-07-13 08:09:00 +02:00
dcd70dd299 Update Dockerfile 2023-06-14 13:28:06 +02:00
a295ac337d „scripts/start.sh“ ändern 2022-10-25 10:59:28 +02:00
e712070a37 „Dockerfile“ ändern 2022-09-08 08:36:13 +02:00
fc31e10b7c „Dockerfile“ ändern 2022-05-06 09:05:58 +02:00
1cb7ab5f8b „README.md“ ändern 2022-04-18 13:07:46 +02:00
82b45708e5 Merge pull request #19 from Ornias1993/patch-1
ensure group is linked correctly
2022-04-07 16:58:05 +02:00
Kjeld Schouten-Lebbing
27f2c6ee47 Update start.sh 2022-04-07 14:36:32 +02:00
Kjeld Schouten-Lebbing
0fb3b33466 Update scripts/start.sh 2022-04-07 13:45:57 +02:00
Kjeld Schouten-Lebbing
2bcce9f74e Apply suggestions from code review
Co-authored-by: Christoph <christophhummer@gmail.com>
2022-04-07 13:17:32 +02:00
Kjeld Schouten-Lebbing
4f2d323874 shrink code and add clearer logging 2022-04-07 12:31:54 +02:00
Kjeld Schouten-Lebbing
638550d65d Update start.sh 2022-04-07 12:26:18 +02:00
Kjeld Schouten-Lebbing
58135e9a43 Update scripts/start.sh 2022-04-07 00:44:32 +02:00
Kjeld Schouten-Lebbing
5bc5d45ffb Update Dockerfile 2022-04-07 00:43:57 +02:00
Kjeld Schouten-Lebbing
8a1b43d82d Update Dockerfile 2022-04-07 00:43:50 +02:00
Kjeld Schouten-Lebbing
d8faf8d04e Support read-only user-scripts 2022-04-06 21:04:50 +02:00
Kjeld Schouten-Lebbing
6cb4fd6f96 Ensure the GID is actually dynamically assigned to a group as well. 2022-04-06 09:48:52 +02:00
Kjeld Schouten-Lebbing
25688e6709 ensure group is created in Dockerfile
This ensures a group is created inside the container before the entrypoint is triggered, as some container engines might trigger a "group not found" error assigning the GID to said group
2022-04-06 09:44:46 +02:00
5e4b466e76 „scripts/start-server.sh“ ändern 2021-12-14 12:50:25 +01:00
72a0e28c71 „README.md“ ändern 2021-12-14 09:02:35 +01:00
82dea2c6af „README.md“ ändern 2021-12-13 11:30:40 +01:00
16d782c55e „Dockerfile“ ändern 2021-09-30 12:23:45 +02:00
58f34acf41 „.github/FUNDING.yml“ hinzufügen 2021-08-27 23:31:33 +02:00
f0ea49bad6 „scripts/start.sh“ ändern 2021-04-14 08:27:32 +02:00
d25c781c22 „Dockerfile“ ändern 2021-04-14 08:12:56 +02:00
056f05756a „scripts/start.sh“ ändern 2021-04-14 08:08:20 +02:00
1c79a312d2 „Dockerfile“ ändern 2021-04-14 08:07:50 +02:00
41df27576a „Dockerfile“ ändern 2021-02-21 08:17:57 +01:00
ad3762e4c0 „Dockerfile“ ändern 2021-02-21 08:17:27 +01:00
821c430387 „Dockerfile“ ändern 2021-02-21 07:59:59 +01:00
37e416a7b1 „scripts/start.sh“ ändern 2020-04-11 14:06:08 +02:00
8d4d03b438 „.drone.yml“ löschen 2020-03-08 20:30:31 +01:00
20a77cae00 „.drone.yml“ hinzufügen
Some checks reported errors
continuous-integration/drone/push Build was killed
2020-03-05 18:56:44 +01:00
2e9463a721 „scripts/start.sh“ ändern 2020-02-25 12:48:41 +01:00
d62dca657f „scripts/start.sh“ ändern 2020-02-25 12:48:13 +01:00
a7a8798ea8 „scripts/start-server.sh“ ändern 2020-02-25 12:19:05 +01:00
94a9d103b6 „scripts/start.sh“ hinzufügen 2020-02-25 12:18:45 +01:00
25509af841 „Dockerfile“ ändern 2020-02-25 12:18:21 +01:00
a82efe30be „Dockerfile“ ändern 2019-12-28 12:31:28 +01:00
704525d91c „Dockerfile“ ändern 2019-12-26 09:56:23 +01:00
252605ca63 „Dockerfile“ ändern 2019-12-26 09:37:14 +01:00
eb266c39f6 code cleanup 2019-12-26 09:30:26 +01:00
57865f566b „Dockerfile“ ändern 2019-12-26 09:28:55 +01:00
d22246d105 „Dockerfile“ ändern 2019-12-26 09:27:28 +01:00
f0137cf7b6 „Dockerfile“ ändern 2019-12-26 09:06:31 +01:00
0f592029f1 „Dockerfile“ ändern 2019-12-26 09:06:06 +01:00
8d283cfe53 switched to debian:buster-slim 2019-12-26 08:48:19 +01:00
becf5dc1a7 „scripts/start-server.sh“ ändern 2019-12-26 08:35:26 +01:00
4278fc8884 „scripts/start-server.sh“ ändern 2019-12-26 08:21:34 +01:00
700351ff61 „scripts/start-server.sh“ ändern 2019-11-11 10:59:02 +01:00
ed40f24e06 „scripts/start-server.sh“ ändern 2019-11-11 10:58:42 +01:00
8b70b11884 „Dockerfile“ ändern 2019-11-11 10:58:25 +01:00
d71ca52efe „README.md“ ändern 2019-05-29 12:37:47 +02:00
075799da02 „README.md“ ändern 2019-05-29 12:37:14 +02:00
1fea73c677 „scripts/start-server.sh“ ändern 2019-05-20 21:34:55 +02:00
d8471aadf3 „scripts/start-server.sh“ ändern 2019-05-20 17:03:45 +02:00
500275b668 „Dockerfile“ ändern 2019-05-20 16:44:28 +02:00
f603c5a482 Update start-server.sh 2019-05-07 21:50:15 +02:00
20e2a492b6 Update Dockerfile 2019-05-07 21:49:40 +02:00
1af4324c74 Update start-server.sh 2019-04-29 17:30:58 +02:00
83c8ce9cc4 Update start-server.sh 2019-04-24 12:59:19 +02:00
5fe96b0b12 Update start-server.sh 2019-04-24 12:13:20 +02:00
d755ec14fa Merge pull request #3 from ich777/beta
Updated to support login
2019-04-23 18:10:56 +02:00
7 changed files with 133 additions and 181 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: ich777

View File

@@ -4,30 +4,28 @@ LABEL org.opencontainers.image.authors="admin@minenet.at"
LABEL org.opencontainers.image.source="https://github.com/ich777/docker-steamcmd-server"
RUN apt-get update && \
apt-get -y install --no-install-recommends lib32gcc-s1 libsqlite3-0 libgdiplus unzip && \
apt-get -y install --no-install-recommends lib32gcc-s1 lib32stdc++6 lib32z1 screen && \
rm -rf /var/lib/apt/lists/*
RUN wget -O /tmp/gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz && \
tar -C /usr/bin/ -xvf /tmp/gotty.tar.gz && \
rm -rf /tmp/gotty.tar.gz
ENV DATA_DIR="/serverdata"
ENV STEAMCMD_DIR="${DATA_DIR}/steamcmd"
ENV SERVER_DIR="${DATA_DIR}/serverfiles"
ENV GAME_ID="template"
ENV GAME_NAME="template"
ENV GAME_PARAMS="template"
ENV GAME_PORT=28015
ENV QUERY_PORT=28016
ENV RCON_PORT=28017
ENV APP_PORT=28018
ENV SERVER_NAME="RustDocker"
ENV SERVER_DISCRIPTION="Simple Unraid Rust Docker"
ENV OXIDE_MOD="false"
ENV CARBON_MOD="false"
ENV FORCE_OXIDE_INSTALLATION="true"
ENV GAME_PORT=27015
ENV VALIDATE=""
ENV GOTTY_PARAMS="-w --title-format SteamLogin"
ENV LOGIN_TIMEOUT=60
ENV UMASK=000
ENV UID=99
ENV GID=100
ENV USERNAME=""
ENV PASSWRD=""
ENV USERNAME="steamuser"
ENV PASSWRD="steampwd"
ENV USER="steam"
ENV DATA_PERM=770

View File

@@ -1,44 +1,40 @@
# SteamCMD in Docker optimized for Unraid
This Docker will download and install SteamCMD. It will also install RUST and run it.
This Docker will download and install SteamCMD and the according game that is pulled via specifying the Tag.
**Update Notice:** Simply restart the container if a newer version of the game is available.
**Please see the different Tags/Branches which games are available.**
## Env params
## Example Env params for CS:Source
| Name | Value | Example |
| --- | --- | --- |
| STEAMCMD_DIR | Folder for SteamCMD | /serverdata/steamcmd |
| SERVER_DIR | Folder for gamefile | /serverdata/serverfiles |
| GAME_ID | The GAME_ID that the container downloads at startup. If you want to use a beta version of the game enter this: '258550 -beta staging' or '258550 -beta prerelease' (without quotes). | 258550 |
| GAME_PARAMS | Enter here your extra game startup parameters if needed starting with (eg: '+rcon.port 27016 +rcon.password YOURPASSWORD' don't forget to add also a new port mapping with container and host port set to the corresponding RCON port) | +server.maxplayers 10 |
| SERVER_NAME | Name of the Server goes here | RustDockerServer |
| SERVER_DISCRIPTION | Server Description goes here | Simple Unraid Rust Docker Server |
| OXIDE_MOD | Set to 'true' (without quotes) to enable Oxide Mod, otherwise leave empty (the container will check on every start/restart if there is a newer version available). | false |
| CARBON_MOD | Set to 'true' (without quotes) to enable Carbon Mod, otherwise leave empty (the container will check on every start/restart if there is a newer version available). | false |
| GAME_PORT | Game port on which the server is running (has to match the port mapping in your container). | 28015 |
| GAME_ID | The GAME_ID that the container downloads at startup. If you want to install a static or beta version of the game change the value to: '232330 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 232330 |
| GAME_NAME | SRCDS gamename | cstrike |
| GAME_PARAMS | Values to start the server | -secure +maxplayers 32 +map de_dust2 |
| UID | User Identifier | 99 |
| GID | Group Identifier | 100 |
| VALIDATE | Validates the game data | false |
| GAME_PORT | Port the server will be running on | 27015 |
| VALIDATE | Validates the game data | blank |
| USERNAME | Leave blank for anonymous login | blank |
| PASSWRD | Leave blank for anonymous login | blank |
## Run example
## Run example for CS:Source
```
docker run --name RUST -d \
-p 28015:28015/udp \
--env 'GAME_ID=258550' \
--env 'SERVER_NAME=RustDockerServer' \
--env 'SERVER_DISCRIPTION=Simple Unraid Rust Docker Server' \
--env 'GAME_PARAMS=+server.maxplayers 10' \
--env 'GAME_PORT=28015' \
docker run --name CSSource -d \
-p 27015:27015 -p 27015:27015/udp \
--env 'GAME_ID=232330' \
--env 'GAME_NAME=cstrike' \
--env 'GAME_PORT=27015' \
--env 'GAME_PARAMS=-secure +maxplayers 32 +map de_dust2' \
--env 'UID=99' \
--env 'GID=100' \
--volume /path/to/steamcmd:/serverdata/steamcmd \
--volume /path/to/rust:/serverdata/serverfiles \
ich777/steamcmd:rust
--volume /path/to/cstrikesource:/serverdata/serverfiles \
ich777/steamcmd:latest
```
This Docker was mainly edited for better use with Unraid, if you don't use Unraid you should definitely try it!
This Docker is forked from mattieserver, thank you for this wonderfull Docker.
### Support Thread: https://forums.unraid.net/topic/79530-support-ich777-gameserver-dockers/
#### Support Thread: https://forums.unraid.net/topic/79530-support-ich777-gameserver-dockers/

9
scripts/start-gotty.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
TERM=linux gotty ${GOTTY_PARAMS} screen -xS steamcmd &
killpid="$(pgrep screen)"
while true
do
tail --pid=$killpid -f /dev/null
kill "$(pidof gotty)"
exit 0
done

View File

@@ -1,165 +1,100 @@
#!/bin/bash
if [ ! -f ${STEAMCMD_DIR}/steamcmd.sh ]; then
echo "SteamCMD not found!"
wget -q -O ${STEAMCMD_DIR}/steamcmd_linux.tar.gz http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --directory ${STEAMCMD_DIR} -xvzf /serverdata/steamcmd/steamcmd_linux.tar.gz
rm ${STEAMCMD_DIR}/steamcmd_linux.tar.gz
echo "SteamCMD not found!"
wget -q -O ${STEAMCMD_DIR}/steamcmd_linux.tar.gz http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --directory ${STEAMCMD_DIR} -xvzf /serverdata/steamcmd/steamcmd_linux.tar.gz
rm ${STEAMCMD_DIR}/steamcmd_linux.tar.gz
fi
echo "---Update SteamCMD---"
if [ "${USERNAME}" == "" ]; then
${STEAMCMD_DIR}/steamcmd.sh \
+login anonymous \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+login ${USERNAME} ${PASSWRD} \
+quit
fi
${STEAMCMD_DIR}/steamcmd.sh \
+login anonymous \
+quit
echo "---Update Server---"
if [ "${USERNAME}" == "" ]; then
if [ "${VALIDATE}" == "true" ]; then
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} validate \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update ${GAME_ID} \
+quit
fi
else
if [ "${VALIDATE}" == "true" ]; then
echo "---Validating installation---"
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} validate \
+quit
else
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} \
+quit
fi
fi
if [ "${OXIDE_MOD}" == "true" ] && [ "${CARBON_MOD}" == "true" ]; then
echo "---Oxide and Carbon mod enabled, you can only enable one at a time, putting container into sleep mode.--"
if [[ ! $LOGIN_TIMEOUT =~ ^[0-9]+$ ]]; then
echo "LOGIN_TIMEOUT must be a integer, putting container into sleep mode!"
sleep infinity
fi
if [ "${OXIDE_MOD}" == "true" ]; then
echo "---Oxide Mod enabled!---"
CUR_V="$(find ${SERVER_DIR} -maxdepth 1 -name "OxideMod-*.zip" | cut -d '-' -f2)"
LAT_V="$(wget -qO- https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | grep tag_name | cut -d '"' -f4)"
if [ -z ${LAT_V} ]; then
if [ -z ${CUR_V%.*} ]; then
echo "---Can't get latest Oxide Mod version and found no installed version, putting server into sleep mode!---"
sleep infinity
else
echo "---Can_t get latest Oxide Mod version, falling back to installed v${CUR_V%.*}!---"
LAT_V="${CUR_V%.*}"
fi
if [ "$LOGIN_TIMEOUT" -gt 0 ]; then
echo "---Update Server---"
if [ "$LOGIN_TIMEOUT" -lt 5 ]; then
echo "LOGIN_TIMEOUT must be greater than 5 seconds, changing to 30!"
LOGIN_TIMEOUT=30
fi
if [ -z "${CUR_V%.}" ]; then
echo "---Oxide Mod not found, downloading!---"
rm -f ${SERVER_DIR}/OxideMod-*.zip
cd ${SERVER_DIR}
if wget -q -nc --show-progress --progress=bar:force:noscroll -O ${SERVER_DIR}/OxideMod-${LAT_V}.zip "https://github.com/OxideMod/Oxide.Rust/releases/download/${LAT_V}/Oxide.Rust-linux.zip" ; then
echo "---Successfully downloaded Oxide Mode v${LAT_V}!---"
else
echo "---Something went wrong, can't download Oxide Mod v${LAT_V}, putting server in sleep mode---"
sleep infinity
fi
unzip -o ${SERVER_DIR}/OxideMod-${LAT_V}.zip -d ${SERVER_DIR}
elif [ "${LAT_V}" != "${CUR_V%.*}" ]; then
cd ${SERVER_DIR}
rm -rf ${SERVER_DIR}/OxideMod-*.zip
echo "---Newer version of Oxide Mod v${LAT_V} found, currently installed: v${CUR_V%.*}---"
if wget -q -nc --show-progress --progress=bar:force:noscroll -O ${SERVER_DIR}/OxideMod-${LAT_V}.zip "https://github.com/OxideMod/Oxide.Rust/releases/download/${LAT_V}/Oxide.Rust-linux.zip" ; then
echo "---Successfully downloaded Oxide Mod v${LAT_V}!---"
else
echo "---Something went wrong, can't download Oxide Mod v${LAT_V}, putting server in sleep mode---"
sleep infinity
fi
unzip -o ${SERVER_DIR}/OxideMod-${LAT_V}.zip -d ${SERVER_DIR}
elif [ "$LAT_V" == "${CUR_V%.*}" ]; then
echo "---Oxide Mod v${CUR_V%.*} is Up-To-Date!---"
if [ ! -f ~/.screenrc ]; then
echo "defscrollback 30000
bindkey \"^C\" echo 'Blocked. Close this window to exit the terminal.'" > ~/.screenrc
fi
if [ "${FORCE_OXIDE_INSTALLATION}" == "true" ]; then
unzip -o ${SERVER_DIR}/OxideMod-${LAT_V}.zip -d ${SERVER_DIR}
screen -wipe 2&>/dev/null
if [ ! -d ${DATA_DIR}/Steam/logs ]; then
mkdir -p ${DATA_DIR}/Steam/logs
elif [ -f ${DATA_DIR}/Steam/logs/steamcmd.log ]; then
rm -f ${DATA_DIR}/Steam/logs/steamcmd.log
fi
screen -S steamcmd -L -Logfile ${DATA_DIR}/Steam/logs/steamcmd.log -d -m \
${STEAMCMD_DIR}/steamcmd.sh \
+force_install_dir ${SERVER_DIR} \
+login ${USERNAME} ${PASSWRD} \
+app_update ${GAME_ID} \
+quit
sleep 1
/opt/scripts/start-gotty.sh >/dev/null 2>&1 &
echo "+----------------------------------------------------------------------"
echo "| Please connect to the built in SteamCMD web console (not the Docker"
echo "| console) and enter your 2FA token if you have SteamGuard enabled."
echo "|"
echo "| You can close the SteamCMD web console after entering the 2FA token."
echo "+----------------------------------------------------------------------"
echo
echo "Waiting $LOGIN_TIMEOUT seconds for login..."
echo
ELAPSED_TIME=0
while [ $ELAPSED_TIME -lt $LOGIN_TIMEOUT ]; do
if grep -q "Waiting for user info...OK" ${DATA_DIR}/Steam/logs/steamcmd.log; then
echo "Login successfull, continuing, please wait..."
sed -i 's/^Two-factor code:.*/Two-factor code:\*HIDDEN\*/' ${DATA_DIR}/Steam/logs/steamcmd.log
/opt/scripts/start-tail.sh
rm -f ${DATA_DIR}/Steam/logs/steamcmd.log
screen -wipe 2&>/dev/null
LOGINOK="true"
break
else
sleep 2
((ELAPSED_TIME += 2))
fi
done
if [ "$LOGINOK" != "true" ]; then
echo "Login Failed after $LOGIN_TIMEOUT seconds, continuing..."
kill -SIGKILL $(pgrep screen) >/dev/null 2>&1
kill -SIGKILL $(pidof gotty) >/dev/null 2>&1
sed -i 's/^Two-factor code:.*/Two-factor code:\*HIDDEN\*/' ${DATA_DIR}/Steam/logs/steamcmd.log
cat ${DATA_DIR}/Steam/logs/steamcmd.log
rm -f ${DATA_DIR}/Steam/logs/steamcmd.log >/dev/null 2>&1
screen -wipe 2&>/dev/null
fi
else
echo "LOGIN_TIMEOUT set to 0, Update Server skipped!"
fi
if [ "${CARBON_MOD}" == "true" ]; then
echo "---Carbon Mod enabled!---"
CUR_V="$(find ${SERVER_DIR} -maxdepth 1 -name "CarbonMod-*.tar.gz" | cut -d '-' -f2)"
LAT_V="$(wget -qO- https://api.github.com/repos/CarbonCommunity/Carbon/releases/latest | grep tag_name | cut -d '"' -f4)"
if [ -z ${LAT_V} ]; then
if [ -z ${CUR_V%.tar.gz} ]; then
echo "---Can't get latest Carbon Mod version and found no installed version, putting server into sleep mode!---"
sleep infinity
else
echo "---Can_t get latest Carbon Mod version, falling back to installed v${CUR_V%.tar.gz}!---"
LAT_V="${CUR_V%.tar.gz}"
fi
fi
if [ -z "${CUR_V%.tar.gz}" ]; then
echo "---Carbon Mod not found, downloading!---"
rm -f ${SERVER_DIR}/CarbonMod-*.tar.gz
cd ${SERVER_DIR}
if wget -q -nc --show-progress --progress=bar:force:noscroll -O ${SERVER_DIR}/CarbonMod-${LAT_V}.tar.gz "https://github.com/CarbonCommunity/Carbon/releases/download/${LAT_V}/Carbon.Linux.Release.tar.gz" ; then
echo "---Successfully downloaded Carbon Mode ${LAT_V}!---"
else
echo "---Something went wrong, can't download Carbon Mod ${LAT_V}, putting server in sleep mode---"
sleep infinity
fi
tar -xvf ${SERVER_DIR}/CarbonMod-${LAT_V}.tar.gz -C ${SERVER_DIR}
#unzip -o ${SERVER_DIR}/CarbonMod-${LAT_V}.zip -d ${SERVER_DIR}
elif [ "${LAT_V}" != "${CUR_V%.tar.gz}" ]; then
cd ${SERVER_DIR}
rm -rf ${SERVER_DIR}/CarbonMod-*.tar.gz
echo "---Newer version of Carbon Mod ${LAT_V} found, currently installed: v${CUR_V%.tar.gz}---"
if wget -q -nc --show-progress --progress=bar:force:noscroll -O ${SERVER_DIR}/CarbonMod-${LAT_V}.tar.gz "https://github.com/CarbonCommunity/Carbon/releases/download/${LAT_V}/Carbon.Linux.Release.tar.gz" ; then
echo "---Successfully downloaded Carbon Mod ${LAT_V}!---"
else
echo "---Something went wrong, can't download Carbon Mod ${LAT_V}, putting server in sleep mode---"
sleep infinity
fi
tar -xvf ${SERVER_DIR}/CarbonMod-${LAT_V}.tar.gz ${SERVER_DIR}
elif [ "$LAT_V" == "${CUR_V%.tar.gz}" ]; then
echo "---Carbon Mod ${CUR_V%.tar.gz} is Up-To-Date!---"
fi
if [ "${FORCE_CARBON_INSTALLATION}" == "true" ]; then
tar -xvf ${SERVER_DIR}/CarbonMod-${LAT_V}.tar.gz -C ${SERVER_DIR}
fi
source "${SERVER_DIR}/carbon/tools/environment.sh"
fi
export USERNAME="secret"
export PASSWRD="secret"
echo "---Prepare Server---"
chmod -R ${DATA_PERM} ${DATA_DIR}
echo "---Setting Library path---"
export LD_LIBRARY_PATH=:/bin/RustDedicated_Data/Plugins/x86_64
echo "---Server ready---"
echo "---Start Server---"
cd ${SERVER_DIR}
if [ ! -f ${SERVER_DIR}/RustDedicated ]; then
echo "---Can't find game executable, putting server into sleep mode!---"
sleep infinity
else
${SERVER_DIR}/RustDedicated -batchmode -server.port ${GAME_PORT} -server.queryport ${QUERY_PORT} -rcon.port ${RCON_PORT} -app.port ${APP_PORT} -server.hostname "${SERVER_NAME}" -server.description "${SERVER_DISCRIPTION}" ${GAME_PARAMS}
fi
echo
echo "---Putting container into sleep mode zZzZzZzZz---"
sleep infinity

14
scripts/start-tail.sh Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
tail -n 100 -f ${DATA_DIR}/Steam/logs/steamcmd.log
sleep 5
killpid="$(pidof gotty)"
while true
do
if [ -z "$killpid" ]; then
kill $(pidof tail)
exit 0
fi
tail --pid=$killpid -f /dev/null
kill $(pidof tail)
exit 0
done

View File

@@ -26,9 +26,8 @@ chown -R ${UID}:${GID} ${DATA_DIR}
echo "---Starting...---"
term_handler() {
kill -SIGINT $(pidof RustDedicated)
tail --pid=$(pidof RustDedicated) -f 2>/dev/null
sleep 0.5
kill -SIGTERM "$killpid"
wait "$killpid" -f 2>/dev/null
exit 143;
}
@@ -39,4 +38,4 @@ while true
do
wait $killpid
exit 0;
done
done