Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f2272b619 | ||
|
|
bdada7cf14 | ||
|
|
9cab9f3143 | ||
|
|
63478199b4 | ||
|
|
2fa0268a66 | ||
|
|
c95d2ecee5 | ||
|
|
64eb6faefb | ||
|
|
22ddb0a9f2 | ||
|
|
3382776c04 | ||
|
|
63883f3a14 | ||
|
|
041fd3f72f | ||
| b8aa544672 | |||
|
|
f9eb78464e | ||
|
|
3279036d9c | ||
|
|
5e2c5a104e | ||
|
|
ba88040b28 | ||
|
|
77852d1d85 | ||
|
|
7889b1d32b | ||
|
|
f7c3a3ea5a | ||
|
|
08cadd8cda | ||
|
|
063351544d | ||
|
|
b9b5a73d71 | ||
|
|
ea4f4bf850 | ||
|
|
f158380306 | ||
|
|
5709330af5 | ||
|
|
6816f5ba10 | ||
|
|
62e7b86882 | ||
|
|
8bf21b6879 | ||
|
|
8b7e334288 |
@@ -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
28
fix_gcc.sh
Normal 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
41
fix_gcc_container.sh
Normal 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
30
install_full.sh
Normal 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
|
||||
@@ -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
33
install_mods.sh
Normal 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."
|
||||
Reference in New Issue
Block a user