From e45478f9f401a88f6694936e51b677f8221a59cd Mon Sep 17 00:00:00 2001 From: Lucas Briese Date: Sun, 21 Jul 2019 23:04:39 +0200 Subject: [PATCH] - removed old files / testing files --- Dockerfile | 62 ------------------------ entrypoint.sh | 68 -------------------------- experimental.sh | 55 --------------------- forceWorkshopDownload.sh | 28 ----------- installAndMountAddons.sh | 48 ------------------- server.cfg | 101 --------------------------------------- 6 files changed, 362 deletions(-) delete mode 100644 Dockerfile delete mode 100644 entrypoint.sh delete mode 100644 experimental.sh delete mode 100644 forceWorkshopDownload.sh delete mode 100644 installAndMountAddons.sh delete mode 100644 server.cfg diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3ccc9ef..0000000 --- a/Dockerfile +++ /dev/null @@ -1,62 +0,0 @@ -FROM debian:stretch - -EXPOSE 27015/udp 27015/tcp - -ENV STEAM_PATH="/home/steam" \ - SERVER_PATH="/home/steam/serverfiles" \ - STEAM_CMD="/home/steam/steamcmd" \ - GROUP_ID=10000 \ - USER_ID=10000 \ - DOCKER_USER=steam \ - \ - WORKSHOP_COLLECTION_ID= \ - SERVER_NAME="" \ - SERVER_PASSWORD="" \ - SERVER_VOICE_ENABLE="1" \ - \ - INSTALL_CSS=false \ - INSTALL_HL2=false \ - INSTALL_HLDM=false \ - INSTALL_TF2=false \ - \ - CSS_PATH="/home/steam/addons/css" \ - HL2_PATH="/home/steam/addons/hl2" \ - HLDM_PATH="/home/steam/addons/hldm" \ - TF2_PATH="/home/steam/addons/tf2" \ - \ - USE_MY_REPLACER_CONFIG=false \ - DEBIAN_FRONTEND=noninteractive - -ENTRYPOINT ["./home/entrypoint.sh"] - -COPY ["entrypoint.sh", "experimental.sh", "forceWorkshopDownload.sh", "installAndMountAddons.sh", "/home/"] - -# removed dep. lib32gcc1 libtcmalloc-minimal4:i386 gdb -#sudo dpkg --add-architecture i386; -RUN dpkg --add-architecture i386 && \ - apt-get update -y && \ - apt-get install -y mailutils postfix curl wget file bzip2 gzip unzip bsdmainutils python util-linux ca-certificates \ - binutils bc jq tmux lib32gcc1 libstdc++6 libstdc++6:i386 lib32tinfo5 \ - locales sudo cron && \ - \ - groupadd -g $GROUP_ID $DOCKER_USER && \ - useradd -d "$STEAM_PATH" -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \ - chown "$DOCKER_USER:$DOCKER_USER" /home/entrypoint.sh && \ - sudo -u "$DOCKER_USER" mkdir -p "$SERVER_PATH" && \ - chown -R "$DOCKER_USER:$DOCKER_USER" "$STEAM_PATH" && \ - chmod a=rx /home/entrypoint.sh && \ - chmod a=rx /home/experimental.sh && \ - chmod a=rx /home/forceWorkshopDownload.sh && \ - chmod a=rx /home/installAndMountAddons.sh && \ - \ - ulimit -n 2048 && \ - sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && \ - locale-gen && \ - \ - wget -O "$STEAM_PATH/linuxgsm.sh" "https://linuxgsm.sh" && \ - chown "$DOCKER_USER:$DOCKER_USER" "$STEAM_PATH/linuxgsm.sh" && \ - chmod +x "$STEAM_PATH/linuxgsm.sh" - -USER "$USER_ID:$GROUP_ID" - -VOLUME "$SERVER_PATH" diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 54d04d0..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -sleep 2s -echo "starting entrypoint.sh" -set -e - -cd "$STEAM_PATH" -#suggested -disableluarefresh -tickrate 66 +host_workshop_collection -port 27015 - -if [ -e "${STEAM_PATH}/gmodserver" ]; then - ./gmodserver update-lgsm - ./gmodserver update -else - bash linuxgsm.sh gmodserver - ./gmodserver auto-install -fi - -cd "/home" -echo "check various options" -./experimental.sh -echo "force workshop download" -./forceWorkshopDownload.sh -echo "install & mount gamefiles" -./installAndMountAddons.sh -cd "$STEAM_PATH" - -#docker args -> lgsm args -temp="" -temp=$(printf "%s " "$@") || true -export parms="-game garrysmod +gamemode terrortown $temp" -if [ -e "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" ]; then - rm -f "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" -fi -mkdir -p "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/" -touch "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" -echo "fn_parms(){" > "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" -echo "parms="'"'"$parms"'"' >> "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" -echo "}" >> "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" -echo "starting with $parms" - -#force fetch of command_console.sh -if [ ! -e "${STEAM_PATH}/lgsm/functions/command_console.sh" ]; then - wget -O "${STEAM_PATH}/lgsm/functions/command_console.sh" "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/functions/command_console.sh" - chmod +x "${STEAM_PATH}/lgsm/functions/command_console.sh" -fi -#skip confirmation -sed -i 's/! fn_prompt_yn "Continue?" Y/[ "1" != "1" ]/' "${STEAM_PATH}/lgsm/functions/command_console.sh" - -#start server -IS_RUNNING="true" -function stopServer() { - echo "stopping server..." - cd "${STEAM_PATH}" - kill -2 "$(pidof srcds_linux)" || true - kill -2 "$(pidof srcds_run)" || true - echo "server stopped!" - echo "stopping entrypoint..." - IS_RUNNING="false" -} -./gmodserver start -trap stopServer SIGTERM -echo "Server is running, waiting for SIGTERM" -while [ "$IS_RUNNING" = "true" ] -do - sleep 1s -done -echo "entrypoint stopped" -exit 0 \ No newline at end of file diff --git a/experimental.sh b/experimental.sh deleted file mode 100644 index e4f0fd4..0000000 --- a/experimental.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -set -e - -function configReplace() { - source="$1" - target="$source \"$2\"" - #grep -c would be nicer - # shellcheck disable=SC2126 - count=$(grep -Po "($source).+" "${SERVER_PATH}/garrysmod/cfg/server.cfg" | wc -l) - - echo "Request for replacing $source to $target, source is found $count times" - - if [ "$count" == "1" ]; then - source=$(grep -Po "($source).+" "${SERVER_PATH}/garrysmod/cfg/server.cfg" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g') - target=$(echo "$target" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g') - sed -i "s/$source/$target/g" "${SERVER_PATH}/garrysmod/cfg/server.cfg" - elif [ "$count" == "0" ]; then - echo "" >> "${SERVER_PATH}/garrysmod/cfg/server.cfg" - echo "$target" >> "${SERVER_PATH}/garrysmod/cfg/server.cfg" - else - echo "can't set $1 because there are multiple in" - fi -} - -#create default server.config -# not empty: grep -q '[^[:space:]]' < 'server.cfg' && echo "not empty" -#grep -c would be nicer -# shellcheck disable=SC2126 -if [ ! -e "${SERVER_PATH}/garrysmod/cfg/server.cfg" ] || [ "0" = "$(grep -o '[^[:space:]]' "${SERVER_PATH}/garrysmod/cfg/server.cfg" | wc -l)" ]; then - mkdir -p "${SERVER_PATH}/garrysmod/cfg" - wget -O "${SERVER_PATH}/garrysmod/cfg/server.cfg" "https://raw.githubusercontent.com/jusito/docker-ttt/master/server.cfg" - chown "$USER_ID:$GROUP_ID" "${SERVER_PATH}/garrysmod/cfg/server.cfg" - chmod u+rw "${SERVER_PATH}/garrysmod/cfg/server.cfg" -fi - -#set hostname & password, working if only one entry is in -if [ -n "${SERVER_NAME}" ]; then - configReplace "hostname" "$SERVER_NAME" -fi -if [ -n "${SERVER_PASSWORD}" ]; then - configReplace "sv_password" "$SERVER_PASSWORD" -fi -if [ -n "${SERVER_VOICE_ENABLE}" ]; then - configReplace "sv_voiceenable" "$SERVER_VOICE_ENABLE" -fi - - - -#this is a simple option for myself, but you can use it too -if [ "$USE_MY_REPLACER_CONFIG" = "true" ] && [ ! -e "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace" ]; then - mkdir -p "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace" - wget -O "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace/config.txt" "https://raw.githubusercontent.com/jusito/ttt_entity_replace/master/config.txt.example_fas2" -fi - diff --git a/forceWorkshopDownload.sh b/forceWorkshopDownload.sh deleted file mode 100644 index b64668a..0000000 --- a/forceWorkshopDownload.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e - -#using WORKSHOP_COLLECTION_ID -LUA_PATH="${SERVER_PATH}/garrysmod/lua/autorun/server" -LUA_FILE="${LUA_PATH}/workshop_autoload.lua" - -#remove old file -if [ -e "$LUA_FILE" ]; then - rm "$LUA_FILE" -else - mkdir -p "$LUA_PATH" -fi - -if [ "$WORKSHOP_COLLECTION_ID" = "0" ] || [ "$WORKSHOP_COLLECTION_ID" = "" ]; then - echo "given ID is default, no workshop download" -else - touch "$LUA_FILE" - arr=$(wget -q -O - https://steamcommunity.com/sharedfiles/filedetails/?id="${WORKSHOP_COLLECTION_ID}" | tr '\n' ' ' | grep -Po '"workshopItem"[^"]+"https://steamcommunity.com/sharedfiles/filedetails/\?id=(\d+)' | grep -Po '\d\d\d+' ) - str="" - for i in "${arr[@]}" - do - str=${str}"resource.AddWorkshop( \"${i}\" )"$'\n' - done - echo "$str" > "$LUA_FILE" -fi - diff --git a/installAndMountAddons.sh b/installAndMountAddons.sh deleted file mode 100644 index 121308a..0000000 --- a/installAndMountAddons.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -e -cd "$STEAM_CMD" -mount='"mountcfg"'$'\n{\n' -if [ "$INSTALL_CSS" = "true" ]; then - echo "installing & mounting css" - ./steamcmd.sh +login anonymous +force_install_dir "$CSS_PATH" +app_update 232330 validate +quit - mount=${mount}' "cstrike" "'"${CSS_PATH}/cstrike"$'"\n' - if [ "$INSTALL_HL2" != "true" ]; then - mount=${mount}' "hl2" "'"${CSS_PATH}/hl2"$'"\n' - fi -fi -if [ "$INSTALL_HL2" = "true" ]; then - echo "installing & mounting hl2" - ./steamcmd.sh +login anonymous +force_install_dir "$HL2_PATH" +app_update 232370 validate +quit - mount=${mount}' "hl2" "'"${HL2_PATH}/hl2"$'"\n' - mount=${mount}' "hl2mp" "'"${HL2_PATH}/hl2mp"$'"\n' -fi -if [ "$INSTALL_TF2" = "true" ]; then - echo "installing & mounting tf2" - ./steamcmd.sh +login anonymous +force_install_dir "$TF2_PATH" +app_update 232250 validate +quit - mount=${mount}' "tf2" "'"${TF2_PATH}/tf"$'"\n' - if [ "$INSTALL_CSS" != "true" ] && [ "$INSTALL_HL2" != "true" ]; then - mount=${mount}' "hl2" "'"${TF2_PATH}/hl2"$'"\n' - fi -fi -if [ "$INSTALL_HLDM" = "true" ]; then - echo "installing & mounting hldm" - ./steamcmd.sh +login anonymous +force_install_dir "$HLDM_PATH" +app_update 255470 validate +quit - mount=${mount}' "hl1" "'"${HLDM_PATH}/hl1"$'"\n' - mount=${mount}' "hldm" "'"${HLDM_PATH}/hldm"$'"\n' - if [ "$INSTALL_CSS" != "true" ] && [ "$INSTALL_HL2" != "true" ] && [ "$INSTALL_TF2" != "true" ]; then - mount=${mount}' "hl2" "'"${HLDM_PATH}/hl2"$'"\n' - fi -fi -mount=${mount}$'}\n' - - -if [ ! -e "${SERVER_PATH}/garrysmod/cfg" ]; then - mkdir -p "${SERVER_PATH}/garrysmod/cfg" -fi -if [ -e "${SERVER_PATH}/garrysmod/cfg/mount.cfg" ]; then - rm "${SERVER_PATH}/garrysmod/cfg/mount.cfg" -fi -touch "${SERVER_PATH}/garrysmod/cfg/mount.cfg" -echo "$mount" > "${SERVER_PATH}/garrysmod/cfg/mount.cfg" - diff --git a/server.cfg b/server.cfg deleted file mode 100644 index d868572..0000000 --- a/server.cfg +++ /dev/null @@ -1,101 +0,0 @@ -hostname "" -sv_password "" -sv_voiceenable 0 - -sv_contact "unknown" - - -// rcon passsword -sv_rcon_banpenalty 5 -sv_rcon_maxfailures 3 - -//DNA -ttt_killer_dna_range 300 -ttt_killer_dna_basetime 100 - - -//Prep -ttt_firstpreptime 60 -ttt_preptime_seconds 30 -ttt_posttime_seconds 3 - - -//Round length -ttt_haste 0 -// ttt_haste_starting_minutes 5 -// ttt_haste_minutes_per_death 0.5 - -ttt_roundtime_minutes 10 - - - -//Map Switching -ttt_round_limit 10 -ttt_time_limit_minutes 75 - -//ttt_always_use_mapcycle 0 - - -//Player Counts -ttt_minimum_players 2 -ttt_traitor_pct 0.4 -ttt_traitor_max 32 -ttt_detective_pct 0.1 -ttt_detective_max 32 -ttt_detective_min_players 6 -ttt_detective_karma_min 600 - - -//Karma -ttt_karma 1 -ttt_karma_strict 1 -ttt_karma_starting 1000 -ttt_karma_max 1000 -ttt_karma_ratio 0.001 -ttt_karma_kill_penalty 50 -ttt_karma_round_increment 5 -ttt_karma_clean_bonus 30 -ttt_karma_traitordmg_ratio 0.0003 -ttt_karma_traitorkill_bonus 100 -ttt_karma_low_autokick 1 -ttt_karma_low_amount 300 -ttt_karma_low_ban 0 -ttt_karma_low_ban_minutes 60 -ttt_karma_persist 1 -ttt_karma_clean_half 0.25 - -//Other -ttt_postround_dm 0 -ttt_no_nade_throw_during_prep 0 -ttt_weapon_carrying 1 -ttt_weapon_carrying_range 50 -ttt_teleport_telefrags 1 -ttt_ragdoll_pinning 1 -ttt_ragdoll_pinning_innocents 1 -ttt_use_weapon_spawn_scripts 1 -ttt_spawn_wave_interval 2 -ttt_allow_discomb_jump 1 -ttt_debug_preventwin 0 - -// server logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 0 -sv_log_onefile 0 - -// operation -sv_lan 0 -sv_region 3 //Europa - -// traitor -ttt_credits_detectivekill 2 -ttt_credits_award_repeat 0.5 - -// fastdl -sv_allowdownload 1 -sv_allowupload 0 -// sv_downloadurl "your url" - -exec banned_user.cfg -exec banned_ip.cfg \ No newline at end of file