Compare commits

29 Commits

Author SHA1 Message Date
zino
8f2272b619 modified 2023-11-25 03:04:18 +01:00
zino
bdada7cf14 modified 2023-11-25 02:59:59 +01:00
zino
9cab9f3143 modified 2023-11-25 02:34:01 +01:00
zino
63478199b4 modified 2023-11-25 02:30:44 +01:00
zino
2fa0268a66 modified 2023-11-25 02:26:49 +01:00
zino
c95d2ecee5 modified 2023-11-25 02:14:45 +01:00
zino
64eb6faefb modified 2023-11-25 02:02:19 +01:00
zino
22ddb0a9f2 modified 2023-11-25 02:02:02 +01:00
zino
3382776c04 modified 2023-11-25 01:24:22 +01:00
zino
63883f3a14 modified 2023-11-25 00:33:00 +01:00
zino
041fd3f72f modified 2023-11-25 00:18:22 +01:00
b8aa544672 Update docker-compose.yml 2023-11-24 23:27:02 +01:00
zino
f9eb78464e adjust docker compose 2023-11-24 11:03:59 +01:00
zino
3279036d9c modified 2023-11-23 14:49:41 +01:00
zino
5e2c5a104e modified 2023-11-23 14:42:08 +01:00
zino
ba88040b28 modified 2023-11-23 14:40:45 +01:00
zino
77852d1d85 modified 2023-11-23 14:34:05 +01:00
zino
7889b1d32b update server name 2023-11-23 14:33:21 +01:00
zino
f7c3a3ea5a modified 2023-11-23 14:31:14 +01:00
zino
08cadd8cda modified 2023-11-23 14:28:45 +01:00
zino
063351544d modified 2023-11-23 14:26:32 +01:00
zino
b9b5a73d71 simplify 2023-11-23 14:19:39 +01:00
zino
ea4f4bf850 use docker-compose 2023-11-23 14:17:59 +01:00
zino
f158380306 modifed 2023-11-23 14:14:07 +01:00
zino
5709330af5 modified 2023-11-23 14:11:36 +01:00
zino
6816f5ba10 modified 2023-11-23 14:09:28 +01:00
zino
62e7b86882 modified 2023-11-23 14:06:53 +01:00
zino
8bf21b6879 fix gcc inside container 2023-11-23 13:58:15 +01:00
zino
8b7e334288 changed to branch 2023-11-23 11:35:53 +01:00
6 changed files with 156 additions and 24 deletions

View File

@@ -1,12 +1,12 @@
version: "3.8"
services:
server:
image: gameservermanagers/gameserver:cs
# image: ghcr.io/gameservermanagers/gameserver:cs
container_name: lgsm-cs
restart: unless-stopped
volumes:
- ./volumes:/data
ports:
- "27015:27015/udp"
- "27015:27015/tcp"
version: "3.8"
services:
csserver:
image: gameservermanagers/gameserver:cs
# image: ghcr.io/gameservermanagers/gameserver:cs
container_name: csserver
restart: unless-stopped
volumes:
- ./volumes:/data
ports:
- "27015:27015/udp"
- "27015:27015/tcp"

28
fix_gcc.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# File paths
file1="./volumes/serverfiles/libstdc++.so.6"
file2="./volumes/serverfiles/libgcc_s.so.1"
SCRIPT_NAME=$(basename "$0")
# Function to display [INFO] in blue and the message in default color
info() {
printf "\033[0;34m[INFO]\033[0m %s\n" "$1"
}
# Function to check if a file exists and delete it
delete_if_exists() {
local file=$1
if [ -f "$file" ]; then
echo "Deleting file: $file"
rm "$file"
else
echo "File not found: $file"
fi
}
# Check and delete files
delete_if_exists "$file1"
delete_if_exists "$file2"
info "${SCRIPT_NAME} completed."

41
fix_gcc_container.sh Normal file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Set the container name
CONTAINER_NAME="csserver"
SCRIPT_NAME=me=$(basename "$0")
# Function to display [INFO] in blue and the message in default color
info() {
printf "\033[0;34m[INFO]\033[0m %s\n" "$1"
}
# Function to check if the container is running
is_container_running() {
[ "$(docker-compose ps -q ${CONTAINER_NAME} | xargs docker inspect -f '{{.State.Status}}' 2>/dev/null)" = "running" ]
}
# Function to execute commands in the container
execute_in_container() {
info "Executing command in container: $1"
docker-compose exec -T "${CONTAINER_NAME}" sh -c "$1"
}
# Check if the container is running
if ! is_container_running; then
info "Warning: Container ${CONTAINER_NAME} is not running. Please start the container and rerun the script."
exit 1
fi
# FIX 1: Copying libstdc++.so.6 & libgcc_s.so.1 from other source
#execute_in_container "mv /data/serverfiles/libstdc++.so.6 /data/serverfiles/libstdc++.so.6.bak && cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /data/serverfiles/"
#execute_in_container "mv /data/.local/share/Steam/steamcmd/linux32/libstdc++.so.6 /data/.local/share/Steam/steamcmd/linux32/libstdc++.so.6.bak && cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /data/.local/share/Steam/steamcmd/linux32/"
#execute_in_container "mv /data/serverfiles/libgcc_s.so.1 /data/serverfiles/libgcc_s.so.1.bak && cp /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 /data/serverfiles/"
# FIX 2: Removing libstdc++.so.6 & libgcc_s.so.1 and let them get recreated on next container start
execute_in_container "rm /data/serverfiles/libstdc++.so.6"
execute_in_container "rm /data/serverfiles/libgcc_s.so.1"
docker-compose down
info "${SCRIPT_NAME} completed successfully."

30
install_full.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Ensure the script stops if any of the subscripts fails
set -e
# Function to display [INFO] in blue and the message in default color
info() {
printf "\033[0;34m[INFO]\033[0m %s\n" "$1"
}
# Paths to the scripts (adjust these paths as necessary)
SCRIPT1="./fix_gcc.sh"
SCRIPT2="./install_mods.sh"
SCRIPT3="./install_funmaps.sh"
docker-compose up &
sleep 120
info "Executing ${SCRIPT1}..."
bash "$SCRIPT1"
info "Executing ${SCRIPT2}..."
bash "$SCRIPT2"
info "Executing ${SCRIPT3}..."
bash "$SCRIPT3"
info "All scripts executed successfully."
docker-compose restart

View File

@@ -5,14 +5,14 @@
# Exit immediately if a command exits with a non-zero status
set -e
# Git variables
GIT_ADDRESS="ssh://git@git.zinomedia.de:222"
REPO_NAME="zino/lgsm-cs-funmaps-addon.git"
# Directory variables
VOLUMES_DIR="${CURRENT_DIR}/volumes"
CURRENT_DIR="${PWD}"
CONFIG_REPO_DIR="$(mktemp -d)"
VOLUMES_DIR="${CURRENT_DIR}/volumes"
TEMP_DIR="$(mktemp -d ./temp.XXXXXX)"
# Combined Git clone command
GIT_COMMAND="sudo git clone -b funmaps ssh://git@git.zinomedia.de:222/zino/lgsm-csserver.git ${TEMP_DIR}"
# Function to display [INFO] in blue and the message in default color
info() {
@@ -21,14 +21,14 @@ info() {
# Function to clone and merge configuration repository
clone_and_merge_config() {
info "Cloning configuration repository to ${CONFIG_REPO_DIR}..."
sudo git clone ${GIT_ADDRESS}/${REPO_NAME} "${CONFIG_REPO_DIR}"
info "Cloning configuration repository to ${TEMP_DIR}..."
${GIT_COMMAND}
info "Merging configuration from ${CONFIG_REPO_DIR} to ${VOLUMES_DIR}..."
sudo rsync -a "${CONFIG_REPO_DIR}/" "${VOLUMES_DIR}/"
info "Merging configuration from ${TEMP_DIR} to ${VOLUMES_DIR}..."
sudo rsync -a "${TEMP_DIR}/" "${VOLUMES_DIR}/"
info "Removing configuration repository from ${CONFIG_REPO_DIR}..."
sudo rm -rf "${CONFIG_REPO_DIR}"
info "Removing configuration repository from ${TEMP_DIR}..."
sudo rm -rf "${TEMP_DIR}"
}
# Main deployment process

33
install_mods.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
# Define the mod names and the response to the additional prompts
MOD_NAME1="metamod"
MOD_NAME2="amxmodx"
MOD_NAME3="amxmodxcs"
RESPONSE_TO_ADDITIONAL_PROMPTS="Y"
# Function to display [INFO] in blue and the message in default color
info() {
printf "\033[0;34m[INFO]\033[0m %s\n" "$1"
}
# Function to install a mod
install_mod() {
local mod_name=$1
{
echo "${mod_name}"
echo "${RESPONSE_TO_ADDITIONAL_PROMPTS}"
} | docker exec -i --user linuxgsm csserver ./csserver mods-install
}
# Install each mod
info "Installing mod: ${MOD_NAME1}"
install_mod "${MOD_NAME1}"
info "Installing mod: ${MOD_NAME2}"
install_mod "${MOD_NAME2}"
info "Installing mod: ${MOD_NAME3}"
install_mod "${MOD_NAME3}"
info "All mods installed successfully."