forked from jammsen/docker-palworld-dedicated-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
38 lines (31 loc) · 1.15 KB
/
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
#!/bin/bash
# shellcheck disable=SC1091
set -e
APP_USER=steam
APP_GROUP=steam
APP_HOME=/home/$APP_USER
source /includes/colors.sh
if [[ "${PUID}" -eq 0 ]] || [[ "${PGID}" -eq 0 ]]; then
ee ">>> Running as root is not supported, please fix your PUID and PGID!"
exit 1
elif [[ "$(id -u steam)" -ne "${PUID}" ]] || [[ "$(id -g steam)" -ne "${PGID}" ]]; then
ew "> Current $APP_USER user PUID is '$(id -u steam)' and PGID is '$(id -g steam)'"
ew "> Setting new $APP_USER user PUID to '${PUID}' and PGID to '${PGID}'"
groupmod -g "${PGID}" "$APP_GROUP" && usermod -u "${PUID}" -g "${PGID}" "$APP_USER"
else
ew "> Current $APP_USER user PUID is '$(id -u steam)' and PGID is '$(id -g steam)'"
ew "> PUID and PGID matching what is requested for user $APP_USER"
fi
chown -R "$APP_USER":"$APP_GROUP" "$APP_HOME"
chown -R "$APP_USER":"$APP_GROUP" "$GAME_ROOT"
chown "$APP_USER":"$APP_GROUP" /entrypoint.sh
chown -R "$APP_USER":"$APP_GROUP" /scripts
chown -R "$APP_USER":"$APP_GROUP" /includes
ls -al /
ls -al /home
ls -al /home/steam
ls -al /home/steam/steamcmd
ls -al /palworld
ls -al /palworld/backups
id steam
exec gosu $APP_USER:$APP_GROUP "$@"