-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-entrypoint.sh
40 lines (32 loc) · 1.15 KB
/
docker-entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -euox pipefail
_server_install() {
echo "Updating server"
"${STEAMCMDDIR}/steamcmd.sh" +login anonymous \
+force_install_dir "${VALHEIMSERVER_DIR}" \
+app_update "${VALHEIMSERVER_APPID}" \
+quit
}
_server_update() {
echo "Updating server"
"${STEAMCMDDIR}/steamcmd.sh" +login anonymous \
+force_install_dir "${VALHEIMSERVER_DIR}" \
+app_update "${VALHEIMSERVER_APPID}" \
+quit
}
_main() {
# if command starts with an option
if [ "${1:0:1}" = '-' ]; then
_server_update
exec ${VALHEIMSERVER_DIR}/valheim_server.x86_64 "$@"
fi
if [ "$1" = 'run' ]; then
_server_update
exec "${VALHEIMSERVER_DIR}/valheim_server.x86_64" -name "My server" \
-port "2456" \
-world "Dedicated" \
-password "secret"
fi
exec "$@"
}
_main "$@"