Skip to content

Commit 91bd883

Browse files
committed
Cleanup and fix update
1 parent a1e46e0 commit 91bd883

File tree

14 files changed

+138
-369
lines changed

14 files changed

+138
-369
lines changed

Dockerfile

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,21 @@ STOPSIGNAL SIGTERM
44

55
####Environments####
66

7-
ENV PUID=1000
8-
ENV PGID=1000
9-
ENV START_MODE=1
10-
ENV TEST_ALERT=no
11-
ENV TimeZone=Europe/Madrid
12-
ENV VERSION=public
13-
ENV MONITOR=yes
14-
ENV BACKUP=yes
15-
ENV LANG=en_US.utf8
16-
ENV HOME=/home/sfserver
17-
18-
##Need use xterm for LinuxGSM##
19-
ENV TERM=xterm
20-
ENV DEBIAN_FRONTEND noninteractive
7+
ENV PUID=1000 PGID=1000 TimeZone=Europe/Madrid HOME=/home/sfserver LANG=en_US.utf8 TERM=xterm DEBIAN_FRONTEND=noninteractive \
8+
START_MODE=1 \
9+
TEST_ALERT=no \
10+
TimeZone=Europe/Madrid \
11+
VERSION=public \
12+
MONITOR=no \
13+
BACKUP=no
2114

2215
####Environments####
2316

2417
##############BASE IMAGE##############
2518

2619
####Labels####
2720
LABEL maintainer="vinanrra"
28-
LABEL build_version="version: 0.0.6"
21+
LABEL build_version="version: 0.0.7"
2922

3023
#####Dependencies####
3124

@@ -65,18 +58,18 @@ RUN dpkg --add-architecture i386 && \
6558

6659
# Install latest su-exec
6760
RUN set -ex; \
68-
\
69-
curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \
70-
\
71-
fetch_deps='gcc libc-dev'; \
72-
apt-get install -y --no-install-recommends $fetch_deps; \
73-
gcc -Wall \
74-
/usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \
75-
chown root:root /usr/local/bin/su-exec; \
76-
chmod 0755 /usr/local/bin/su-exec; \
77-
rm /usr/local/bin/su-exec.c; \
78-
\
79-
apt-get purge -y --auto-remove $fetch_deps
61+
\
62+
curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \
63+
\
64+
fetch_deps='gcc libc-dev'; \
65+
apt-get install -y --no-install-recommends $fetch_deps; \
66+
gcc -Wall \
67+
/usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \
68+
chown root:root /usr/local/bin/su-exec; \
69+
chmod 0755 /usr/local/bin/su-exec; \
70+
rm /usr/local/bin/su-exec.c; \
71+
\
72+
apt-get purge -y --auto-remove $fetch_deps
8073

8174
# Clear unused files
8275
RUN apt clean && \
@@ -93,19 +86,15 @@ RUN adduser --home /home/sfserver --disabled-password --shell /bin/bash --disabl
9386
# Base dir
9487
WORKDIR /home/sfserver
9588

89+
# Download linuxgsm script + perms
9690
RUN set -ex; \
97-
wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh
91+
wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh && \
92+
chmod +x linuxgsm.sh && \
93+
su-exec sfserver bash linuxgsm.sh sfserver
9894

99-
RUN chmod +x linuxgsm.sh && su-exec sfserver bash linuxgsm.sh sfserver
100-
101-
# Add files
102-
ADD install.sh user.sh /home/sfserver/
103-
ADD scripts /home/sfserver/scripts
104-
ADD lgsm/config-lgsm/sfserver/common.cfg /home/sfserver/
105-
ADD lgsm /home/sfserver/lgsm
106-
107-
# Apply permissions
108-
RUN chmod +x install.sh user.sh
95+
# Add files with perms
96+
COPY --chmod=755 install.sh user.sh /home/sfserver/
97+
COPY --chmod=755 scripts /home/sfserver/scripts
10998

11099
##############EXTRA CONFIG##############
111100
#Ports

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ LinuxGSM allows alerts to be received using various methods, multiple alerts can
137137
* Pushover
138138
* Telegram
139139
* Slack
140+
* And more
140141

141142
Alerts settings can be changed in */path/to/LGSM-Config/common.cfg*
142143

install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ scriptsDir="${rootDir}/scripts"
44

55
# Show log function
66
show_log () {
7-
i="0"
8-
# -F = --follow=name --retry
9-
tail -F /home/sfserver/log/console/sfserver-console.log
7+
# -F = --follow=name --retry
8+
tail -F /home/sfserver/log/console/sfserver-console.log
109
}
1110

1211
test_alert () {

lgsm/config-lgsm/sfserver/common.cfg

Lines changed: 0 additions & 172 deletions
This file was deleted.

scripts/check_space.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
#!/bin/bash
22
mkdir -p /home/sfserver/serverfiles/FactoryGame
3-
free=`df -k --output=avail /home/sfserver/serverfiles/FactoryGame | tail -n1` # df -k not df -h
3+
free=$(df -k --output=avail /home/sfserver/serverfiles/FactoryGame | tail -n1) # df -k not df -h
44
freeGB=$(expr $free / 1024 / 1024)
55
if [[ $free -lt 12582912 ]]; then # 12G = 12*1024*1024k
66
space=no
77
fi
8+
9+
if [ "${space,,}" == 'no' ]; then
10+
echo "[ERROR]
11+
=======================================================================
12+
13+
Not enough space.
14+
15+
Needed: 12 GB
16+
Available: $freeGB GB
17+
18+
=======================================================================
19+
"
20+
exit
21+
fi

scripts/check_startMode.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/bin/bash
22

3-
echo "
4-
=======================================================================
5-
IMPORTANT:
6-
7-
START_MODE $START_MODE UNKNOWN
8-
9-
Stopping container...
10-
11-
Check your START_MODE, the number must be between 1 and 6
12-
More info: https://github.com/vinanrra/Docker-Satisfactory#start-modes
13-
=======================================================================
14-
"
3+
echo "[ERROR]
4+
=======================================================================
5+
6+
START_MODE $START_MODE UNKNOWN
7+
8+
Stopping container...
9+
10+
Check your START_MODE, the number must be between 1 and 4
11+
More info: https://github.com/vinanrra/Docker-Satisfactory#start-modes
12+
=======================================================================
13+
"

scripts/crontab/backup.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
#!/bin/bash
22
echo "0 5 * * * /home/sfserver/sfserver backup > /dev/null 2>&1" >> crontab.txt
33

4-
echo "
5-
=======================================================================
6-
IMPORTANT:
7-
8-
Activated automatic backup at 5AM
9-
=======================================================================
10-
"
4+
echo "[INFO] Activated automatic backup"

scripts/crontab/monitor.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
#!/bin/bash
22
echo "*/5 * * * * /home/sfserver/sfserver monitor > /dev/null 2>&1" >> crontab.txt
33

4-
echo "
5-
=======================================================================
6-
IMPORTANT:
7-
8-
Activated server monitoring, automatic restart if crash
9-
=======================================================================
10-
"
4+
echo "[INFO] Activated server monitoring, automatic restart if crash"

0 commit comments

Comments
 (0)