Compare commits
	
		
			12 Commits
		
	
	
		
			37afc92c62
			...
			f726f03659
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f726f03659 | |||
| 
						 | 
					2105a54147 | ||
| 
						 | 
					236a1fbbb9 | ||
| 
						 | 
					d6e98cf13b | ||
| 
						 | 
					494e55c95a | ||
| 
						 | 
					6c8b09438e | ||
| 
						 | 
					1a359f2203 | ||
| 
						 | 
					828f56cf22 | ||
| 
						 | 
					dc83e87e2d | ||
| 
						 | 
					e7aecfe6cb | ||
| 
						 | 
					4ea87f7d24 | ||
| 
						 | 
					470b98a15d | 
							
								
								
									
										16
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
FROM debian:buster-slim as lgsm
 | 
			
		||||
FROM debian:12-slim as lgsm
 | 
			
		||||
 | 
			
		||||
# Const \\ Overwrite Env \\ Configs possible \\ Configs needed 
 | 
			
		||||
# C.UTF-8 -> en_US.UTF-8
 | 
			
		||||
@@ -8,12 +8,11 @@ ENV STEAM_PATH="/home/steam" \
 | 
			
		||||
	GROUP_ID=10000 \
 | 
			
		||||
	USER_ID=10000 \
 | 
			
		||||
	DOCKER_USER=steam \
 | 
			
		||||
	SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64 \
 | 
			
		||||
	SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.28/supercronic-linux-amd64 \
 | 
			
		||||
	SUPERCRONIC=supercronic-linux-amd64 \
 | 
			
		||||
	SUPERCRONIC_SHA1SUM=5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85 \
 | 
			
		||||
	SUPERCRONIC_SHA1SUM=fe1a81a8a5809deebebbd7a209a3b97e542e2bcd \
 | 
			
		||||
	\
 | 
			
		||||
	\
 | 
			
		||||
	DEBIAN_FRONTEND=noninteractive \
 | 
			
		||||
	LANG=C.UTF-8 \
 | 
			
		||||
	TERM=xterm \
 | 
			
		||||
	\
 | 
			
		||||
@@ -40,9 +39,10 @@ COPY ["lgsm/entrypoint.sh", "lgsm/initCron.sh", "lgsm/createAlias.sh", "/home/"]
 | 
			
		||||
# iproute2 needed because of "-slim"
 | 
			
		||||
RUN dpkg --add-architecture i386 && \
 | 
			
		||||
	apt-get update -y && \
 | 
			
		||||
	apt-get install -y bc binutils bsdmainutils bzip2 ca-certificates cpio curl file gzip hostname jq lib32gcc1 lib32stdc++6 netcat python3 tar tmux unzip util-linux wget xz-utils lib32gcc1 lib32stdc++6 libsdl2-2.0-0:i386 distro-info \
 | 
			
		||||
		libtinfo5:i386 \
 | 
			
		||||
		procps iproute2 && \
 | 
			
		||||
	DEBIAN_FRONTEND=noninteractive apt-get install -y bc binutils bsdmainutils bzip2 ca-certificates cpio curl distro-info file gzip hostname jq lib32gcc-s1 lib32stdc++6 netcat-openbsd python3 tar tmux unzip util-linux uuid-runtime wget xz-utils \
 | 
			
		||||
	lib32gcc-s1 lib32stdc++6 libsdl2-2.0-0:i386 \
 | 
			
		||||
	libtinfo5:i386 \
 | 
			
		||||
	procps iproute2 && \
 | 
			
		||||
	\
 | 
			
		||||
	groupadd -g $GROUP_ID $DOCKER_USER && \
 | 
			
		||||
	useradd -d "$STEAM_PATH" -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \
 | 
			
		||||
@@ -140,7 +140,7 @@ ENV CSS_PATH="/home/steam/addons/css" \
 | 
			
		||||
	LGSM_UPDATE=true \
 | 
			
		||||
	\
 | 
			
		||||
	USE_MY_REPLACER_CONFIG=false
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
COPY ["gmod/prepareServer.sh", "gmod/initConfig.sh", "gmod/forceWorkshopDownload.sh", "gmod/installAndMountAddons.sh", "gmod/common.cfg", "/home/"]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -11,24 +11,20 @@ set -o pipefail
 | 
			
		||||
CFG_PATH="${SERVER_PATH}/garrysmod/cfg/gmodserver.cfg"
 | 
			
		||||
 | 
			
		||||
function configReplace() {
 | 
			
		||||
	source="$1"
 | 
			
		||||
	target="\"$2\""
 | 
			
		||||
	
 | 
			
		||||
	count=$(grep -Poc "($source).+" "${CFG_PATH}")
 | 
			
		||||
	
 | 
			
		||||
	echo "[initConfig.sh]Request for replacing $source to $target, source is found $count times"
 | 
			
		||||
	
 | 
			
		||||
	if [ "$count" == "1" ]; then
 | 
			
		||||
		sed -Ei "/${source}.*/d" "${CFG_PATH}"
 | 
			
		||||
		echo "$source $target" >> "${CFG_PATH}"
 | 
			
		||||
		
 | 
			
		||||
	elif [ "$count" == "0" ]; then
 | 
			
		||||
		echo "" >> "${CFG_PATH}"
 | 
			
		||||
		echo "$source $target" >> "${CFG_PATH}"
 | 
			
		||||
		
 | 
			
		||||
	else
 | 
			
		||||
		echo "[initConfig.sh]can't set $1 because there are multiple in"
 | 
			
		||||
	fi
 | 
			
		||||
    local source="$1"
 | 
			
		||||
    local target="$2"
 | 
			
		||||
 | 
			
		||||
    count=$(grep -Ece "^\s*${source}\s" "${CFG_PATH}")
 | 
			
		||||
 | 
			
		||||
    echo "[initConfig.sh]Request for replacing \"$source\" to \"$target\", source is found $count times"
 | 
			
		||||
 | 
			
		||||
    sed -E -i "/^\s${source}\s.*/d" "${CFG_PATH}"
 | 
			
		||||
 | 
			
		||||
    local file_ends_on_newline=$([ "$(tail -c1 "${CFG_PATH}" | wc -l)" -eq 1 ] && echo true || echo false)
 | 
			
		||||
    if ! $file_ends_on_newline; then
 | 
			
		||||
        echo "" >> "${CFG_PATH}"
 | 
			
		||||
    fi
 | 
			
		||||
    echo "$source \"$target\"" >> "${CFG_PATH}"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#create default server.config
 | 
			
		||||
@@ -52,4 +48,4 @@ if [ -n "${SERVER_RCON_PASSWORD}" ]; then
 | 
			
		||||
fi
 | 
			
		||||
if [ -n "${SERVER_VOICE_ENABLE}" ]; then
 | 
			
		||||
	configReplace "sv_voiceenable" "$SERVER_VOICE_ENABLE"
 | 
			
		||||
fi
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ function stopServer() {
 | 
			
		||||
	IS_RUNNING="false"
 | 
			
		||||
	echo "done!"
 | 
			
		||||
}
 | 
			
		||||
./"$SERVER_EXECUTABLE" start &
 | 
			
		||||
./"$SERVER_EXECUTABLE" start
 | 
			
		||||
trap stopServer SIGTERM
 | 
			
		||||
 | 
			
		||||
#start cron
 | 
			
		||||
@@ -71,9 +71,10 @@ bash "/home/initCron.sh"
 | 
			
		||||
 | 
			
		||||
# --- Wait for Shutdown ---
 | 
			
		||||
echo "Server is running, waiting for SIGTERM"
 | 
			
		||||
tail -f /home/steam/log/console/gmodserver-console.log &
 | 
			
		||||
while [ "$IS_RUNNING" = "true" ]
 | 
			
		||||
do
 | 
			
		||||
	sleep 1s
 | 
			
		||||
done
 | 
			
		||||
echo "entrypoint stopped"
 | 
			
		||||
exit 0
 | 
			
		||||
exit 0
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								test/testBuild.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								test/testBuild.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								test/testCaseQuick.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								test/testCaseQuick.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								test/testHealth.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								test/testHealth.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								test/testStyle.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								test/testStyle.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
		Reference in New Issue
	
	Block a user