forked from number13dev/Ark-docker
-
Notifications
You must be signed in to change notification settings - Fork 30
/
user.sh
33 lines (27 loc) · 840 Bytes
/
user.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
#!/bin/sh
# Change the ARK_UID if needed
if [ ! "$(id -u steam)" -eq "$ARK_UID" ]; then
echo "Changing steam uid to $ARK_UID."
usermod -o -u "$ARK_UID" steam ;
fi
# Change gid if needed
if [ ! "$(id -g steam)" -eq "$ARK_GID" ]; then
echo "Changing steam gid to $ARK_GID."
groupmod -o -g "$ARK_GID" steam ;
fi
# Set Timezone
if [ -f /usr/share/zoneinfo/${TZ} ]; then
echo "Setting timezone to '${TZ}'..."
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime
else
echo "Timezone '${TZ}' does not exist!"
fi
# Put steam owner of directories (if the uid changed, then it's needed)
chown -R steam:steam /ark /home/steam
# avoid error message when su -p (we need to read the /root/.bash_rc )
chmod -R 777 /root/
# Starting cron
echo "Starting crond..."
crond
# Launch run.sh with user steam
su -p -c /home/steam/run.sh steam