-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathuser.sh
44 lines (34 loc) · 1.13 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
exit_handler () {
# Execute the shutdown commands
su-exec sfserver /home/sfserver/sfserver stop
exit
}
# Trap specific signals and forward to the exit handler
trap exit_handler SIGTERM
set -eu
# Print info
echo "
=======================================================================
USER INFO:
UID: $PUID
GID: $PGID
MORE INFO:
If you have permission problems remember to use same user UID and GID.
Check it with \"id\" command
If problem persist check:
https://github.com/vinanrra/Docker-Satisfactory/blob/master/README.md
=======================================================================
"
# Set user and group ID to sfserver user
groupmod -o -g "$PGID" sfserver > /dev/null 2>&1
usermod -o -u "$PUID" sfserver > /dev/null 2>&1
# Locale, Timezone and user
ln -snf /usr/share/zoneinfo/"$TimeZone" /etc/localtime && echo "$TimeZone" > /etc/timezone
# Apply owner to the folder to avoid errors
chown -R sfserver:sfserver /home/sfserver
# Start cron
service cron start
# Change user to sfserver
su-exec sfserver bash /home/sfserver/install.sh &
wait $!