uhhh
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
FROM cm2network/steamcmd:root AS build
|
||||
LABEL maintainer="ntr@megastructure.games"
|
||||
|
||||
EXPOSE 27015/tcp \
|
||||
27015/udp \
|
||||
27020/udp
|
||||
|
||||
USER root
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y wget
|
||||
|
||||
ENV CSSDS="/home/steam/cssds"
|
||||
ENV TF2DS="/home/steam/tf2ds"
|
||||
ENV STEAMCMD="/home/steam/steamcmd"
|
||||
ENV ETC="/home/steam/etc"
|
||||
|
||||
# ensure gamedirs exist and have been chowned to steam
|
||||
# before they potentially get setup as docker volumes
|
||||
# which would otherwise cause them to be owned by root
|
||||
RUN mkdir -p "$CSSDS" "$TF2DS" "$STEAMCMD" "$ETC"
|
||||
RUN chown -R steam:steam /home/steam
|
||||
|
||||
FROM build AS steam
|
||||
|
||||
USER steam
|
||||
WORKDIR /home/steam
|
||||
|
||||
ENV METAMOD_VERSION 1.12
|
||||
ENV SOURCEMOD_VERSION 1.12
|
||||
|
||||
COPY etc /home/steam/etc
|
||||
CMD ["bash", "./etc/run.sh"]
|
||||
@@ -0,0 +1,26 @@
|
||||
// Default mapcycle file for Counter-Strike.
|
||||
//
|
||||
// DO NOT MODIFY THIS FILE!
|
||||
// Instead, copy it to mapcycle.txt and modify that file. If no custom mapcycle.txt file is found,
|
||||
// this file will be used as the default.
|
||||
//
|
||||
// Also, note that the "mapcyclefile" convar can be used to specify a particular mapcycle file.
|
||||
|
||||
cs_italy
|
||||
de_dust
|
||||
de_aztec
|
||||
de_cbble
|
||||
cs_office
|
||||
de_chateau
|
||||
de_dust2
|
||||
de_piranesi
|
||||
cs_havana
|
||||
de_prodigy
|
||||
cs_compound
|
||||
de_train
|
||||
de_tides
|
||||
de_port
|
||||
de_inferno
|
||||
cs_assault
|
||||
de_nuke
|
||||
cs_militia
|
||||
@@ -0,0 +1,26 @@
|
||||
// Default mapcycle file for Counter-Strike.
|
||||
//
|
||||
// DO NOT MODIFY THIS FILE!
|
||||
// Instead, copy it to mapcycle.txt and modify that file. If no custom mapcycle.txt file is found,
|
||||
// this file will be used as the default.
|
||||
//
|
||||
// Also, note that the "mapcyclefile" convar can be used to specify a particular mapcycle file.
|
||||
|
||||
cs_italy
|
||||
de_dust
|
||||
de_aztec
|
||||
de_cbble
|
||||
cs_office
|
||||
de_chateau
|
||||
de_dust2
|
||||
de_piranesi
|
||||
cs_havana
|
||||
de_prodigy
|
||||
cs_compound
|
||||
de_train
|
||||
de_tides
|
||||
de_port
|
||||
de_inferno
|
||||
cs_assault
|
||||
de_nuke
|
||||
cs_militia
|
||||
@@ -0,0 +1,195 @@
|
||||
// General Settings //
|
||||
|
||||
// Hostname for server.
|
||||
hostname "New "css" Server"
|
||||
|
||||
// Overrides the max players reported to prospective clients
|
||||
sv_visiblemaxplayers 24
|
||||
|
||||
// Maximum number of rounds to play before server changes maps
|
||||
mp_maxrounds 5
|
||||
|
||||
// Set to lock per-frame time elapse
|
||||
host_framerate 0
|
||||
|
||||
// Set the pause state of the server
|
||||
setpause 0
|
||||
|
||||
// Control where the client gets content from
|
||||
// 0 = anywhere, 1 = anywhere listed in white list, 2 = steam official content only
|
||||
sv_pure 0
|
||||
|
||||
// Is the server pausable
|
||||
sv_pausable 0
|
||||
|
||||
// Type of server 0=internet 1=lan
|
||||
sv_lan 0
|
||||
|
||||
// Collect CPU usage stats
|
||||
sv_stats 1
|
||||
|
||||
|
||||
|
||||
// Execute Banned Users //
|
||||
exec banned_user.cfg
|
||||
exec banned_ip.cfg
|
||||
writeid
|
||||
writeip
|
||||
|
||||
|
||||
|
||||
// Contact & Region //
|
||||
|
||||
// Contact email for server sysop
|
||||
sv_contact test@example.com
|
||||
|
||||
// The region of the world to report this server in.
|
||||
// -1 is the world, 0 is USA east coast, 1 is USA west coast
|
||||
// 2 south america, 3 europe, 4 asia, 5 australia, 6 middle east, 7 africa
|
||||
sv_region -1
|
||||
|
||||
|
||||
|
||||
// Rcon Settings //
|
||||
|
||||
// Password for rcon authentication (Remote CONtrol)
|
||||
rcon_password changeme
|
||||
|
||||
// Number of minutes to ban users who fail rcon authentication
|
||||
sv_rcon_banpenalty 1440
|
||||
|
||||
// Max number of times a user can fail rcon authentication before being banned
|
||||
sv_rcon_maxfailures 5
|
||||
|
||||
|
||||
|
||||
// Log Settings //
|
||||
|
||||
// Enables logging to file, console, and udp < on | off >.
|
||||
log on
|
||||
|
||||
// Log server information to only one file.
|
||||
sv_log_onefile 0
|
||||
|
||||
// Log server information in the log file.
|
||||
sv_logfile 1
|
||||
|
||||
// Log server bans in the server logs.
|
||||
sv_logbans 1
|
||||
|
||||
// Echo log information to the console.
|
||||
sv_logecho 1
|
||||
|
||||
|
||||
|
||||
// Rate Settings //
|
||||
|
||||
// Frame rate limiter
|
||||
fps_max 600
|
||||
|
||||
// Min bandwidth rate allowed on server, 0 == unlimited
|
||||
sv_minrate 0
|
||||
|
||||
// Max bandwidth rate allowed on server, 0 == unlimited
|
||||
sv_maxrate 20000
|
||||
|
||||
// Minimum updates per second that the server will allow
|
||||
sv_minupdaterate 66
|
||||
|
||||
// Maximum updates per second that the server will allow
|
||||
sv_maxupdaterate 66
|
||||
|
||||
|
||||
|
||||
// Download Settings //
|
||||
|
||||
// Allow clients to upload customizations files
|
||||
sv_allowupload 1
|
||||
|
||||
// Allow clients to download files
|
||||
sv_allowdownload 1
|
||||
|
||||
// Maximum allowed file size for uploading in MB
|
||||
net_maxfilesize 15
|
||||
|
||||
|
||||
|
||||
// Team Balancing //
|
||||
|
||||
// Enable team balancing
|
||||
mp_autoteambalance 1
|
||||
|
||||
// Time after the teams become unbalanced to attempt to switch players.
|
||||
mp_autoteambalance_delay 60
|
||||
|
||||
// Time after the teams become unbalanced to print a balance warning
|
||||
mp_autoteambalance_warning_delay 30
|
||||
|
||||
// Teams are unbalanced when one team has this many more players than the other team. (0 disables check)
|
||||
mp_teams_unbalance_limit 1
|
||||
|
||||
|
||||
|
||||
// Round and Game Times //
|
||||
|
||||
// Enable timers to wait between rounds. WARNING: Setting this to 0 has been known to cause a bug with setup times lasting 5:20 (5 minutes 20 seconds) on some servers!
|
||||
mp_enableroundwaittime 1
|
||||
|
||||
// Time after round win until round restarts
|
||||
mp_bonusroundtime 8
|
||||
|
||||
// If non-zero, the current round will restart in the specified number of seconds
|
||||
mp_restartround 0
|
||||
|
||||
// Enable sudden death
|
||||
mp_stalemate_enable 1
|
||||
|
||||
// Timelimit (in seconds) of the stalemate round.
|
||||
mp_stalemate_timelimit 300
|
||||
|
||||
// Game time per map in minutes
|
||||
mp_timelimit 35
|
||||
|
||||
|
||||
|
||||
// Client CVars //
|
||||
|
||||
// Restricts spectator modes for dead players
|
||||
mp_forcecamera 0
|
||||
|
||||
// Toggles whether the server allows spectator mode or not
|
||||
mp_allowspectators 1
|
||||
|
||||
// Toggles footstep sounds
|
||||
mp_footsteps 1
|
||||
|
||||
// Toggles game cheats
|
||||
sv_cheats 0
|
||||
|
||||
// After this many seconds without a message from a client, the client is dropped
|
||||
sv_timeout 900
|
||||
|
||||
// Maximum time a player is allowed to be idle (in minutes), made this and sv_timeout equal same time?
|
||||
mp_idlemaxtime 15
|
||||
|
||||
// Deals with idle players 1=send to spectator 2=kick
|
||||
mp_idledealmethod 2
|
||||
|
||||
// Time (seconds) between decal sprays
|
||||
decalfrequency 30
|
||||
|
||||
|
||||
|
||||
// Communications //
|
||||
|
||||
// enable voice communications
|
||||
sv_voiceenable 1
|
||||
|
||||
// Players can hear all other players, no team restrictions 0=off 1=on
|
||||
sv_alltalk 0
|
||||
|
||||
// Amount of time players can chat after the game is over
|
||||
mp_chattime 10
|
||||
|
||||
// Enable party mode
|
||||
tf_birthday 0
|
||||
@@ -0,0 +1,4 @@
|
||||
//This file re-enables a server from "war mode" by unlocking plugin loading
|
||||
//and refreshing the plugins list.
|
||||
sm plugins load_unlock
|
||||
sm plugins refresh
|
||||
@@ -0,0 +1,10 @@
|
||||
//This file unloads all plugins, re-loads a few "safe" ones, and then prevents
|
||||
//any more plugins from being loaded.
|
||||
sm plugins unload_all
|
||||
sm plugins load_unlock
|
||||
sm plugins load basebans.smx
|
||||
sm plugins load basecommands.smx
|
||||
sm plugins load admin-flatfile.smx
|
||||
sm plugins load adminhelp.smx
|
||||
sm plugins load adminmenu.smx
|
||||
sm plugins load_lock
|
||||
@@ -0,0 +1,138 @@
|
||||
// SourceMod Configuration File
|
||||
// This file is automatically executed by SourceMod every mapchange.
|
||||
|
||||
|
||||
// Specifies how admin activity should be relayed to users. Add up the values
|
||||
// below to get the functionality you want.
|
||||
// 1: Show admin activity to non-admins anonymously.
|
||||
// 2: If 1 is specified, admin names will be shown.
|
||||
// 4: Show admin activity to admins anonymously.
|
||||
// 8: If 4 is specified, admin names will be shown.
|
||||
// 16: Always show admin names to root users.
|
||||
// --
|
||||
// Default: 13 (1+4+8)
|
||||
sm_show_activity 13
|
||||
|
||||
// Specifies whether menu sounds are enabled for menus created by SourceMod.
|
||||
// Menu sounds can be further configured in addons/sourcemod/configs/core.cfg.
|
||||
// --
|
||||
// Default: 1
|
||||
sm_menu_sounds 1
|
||||
|
||||
// Specifies how long of a delay, in seconds, should be used in between votes
|
||||
// that are "public" or can be spammed. Whether or not this delay is obeyed
|
||||
// is dependent on the menu/command.
|
||||
// --
|
||||
// Default: 30
|
||||
sm_vote_delay 30
|
||||
|
||||
// Default datetime formatting rules when displaying to clients.
|
||||
// For full options, see: http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html
|
||||
// --
|
||||
// Default: %m/%d/%Y - %H:%M:%S
|
||||
// 12 hour format: %m/%d/%Y - %I:%M:%S %p
|
||||
sm_datetime_format "%m/%d/%Y - %H:%M:%S"
|
||||
|
||||
// Sets how SourceMod should check immunity levels when administrators target
|
||||
// each other.
|
||||
// 0: Ignore immunity levels (except for specific group immunities).
|
||||
// 1: Protect from admins of lower access only.
|
||||
// 2: Protect from admins of equal to or lower access.
|
||||
// 3: Same as 2, except admins with no immunity can affect each other.
|
||||
// --
|
||||
// Default: 1
|
||||
sm_immunity_mode 1
|
||||
|
||||
// Sets how many seconds SourceMod should adjust time values for incorrect
|
||||
// server clocks. This can be positive or negative and will affect every
|
||||
// system time in SourceMod, including logging stamps.
|
||||
// --
|
||||
// Default: 0
|
||||
sm_time_adjustment 0
|
||||
|
||||
// Specifies the amount of time that is allowed between chat messages. This
|
||||
// includes the say and say_team commands. If a client sends a message faster
|
||||
// than this time, they receive a flood token. When the client has accumulated
|
||||
// 3 or more tokens, a warning message is shown instead of the chat message.
|
||||
// --
|
||||
// Requires: antiflood.smx
|
||||
// Default: 0.75
|
||||
sm_flood_time 0.75
|
||||
|
||||
// Specifies how the reserved slots plugin operates. Valid values are:
|
||||
// 0 : Public slots are used in preference to reserved slots. Reserved slots are freed before public slots.
|
||||
// 1 : If someone with reserve access joins into a reserved slot, the player with the highest latency and
|
||||
// no reserved slot access (spectator players are selected first) is kicked to make room. Thus, the reserved
|
||||
// slots always remains free. The only situation where the reserved slot(s) can become properly occupied is
|
||||
// if the server is full with reserve slot access clients.
|
||||
// 2 : The same as sm_reserve_type 1 except once a certain number of admins have been reached, the reserve slot
|
||||
// stops kicking people and anyone can join to fill the server. You can use this to simulate having a large
|
||||
// number of reserved slots with sm_reserve_type 0 but with only need to have 1 slot unavailable when there are
|
||||
// less admins connected.
|
||||
// --
|
||||
// Requires: reservedslots.smx
|
||||
// Default: 0
|
||||
sm_reserve_type 0
|
||||
|
||||
// Specifies the number of reserved player slots. Users with the reservation
|
||||
// admin flag set will be able to join the server when there are no public slots
|
||||
// remaining. If someone does not have this flag, they will be kicked.
|
||||
// (Public slots are defined as: maxplayers - number of reserved slots)
|
||||
// --
|
||||
// Requires: reservedslots.smx
|
||||
// Default: 0
|
||||
sm_reserved_slots 0
|
||||
|
||||
// Specifies whether or not reserved slots will be hidden (subtracted from max
|
||||
// slot count). Valid values are 0 (Visible) or 1 (Hidden).
|
||||
// --
|
||||
// Requires: reservedslots.smx
|
||||
// Default: 0
|
||||
sm_hide_slots 0
|
||||
|
||||
// Specifies whether or not non-admins can send messages to admins using
|
||||
// say_team @<message>. Valid values are 0 (Disabled) or 1 (Enabled)
|
||||
// --
|
||||
// Requires: basechat.smx
|
||||
// Default: 1
|
||||
sm_chat_mode 1
|
||||
|
||||
// Specifies whether or not "timeleft" will automatically be triggered every
|
||||
// x seconds. Valid values are 0 (Disabled) to 1800 seconds.
|
||||
// --
|
||||
// Requires: basetriggers.smx
|
||||
// Default: 0
|
||||
sm_timeleft_interval 0
|
||||
|
||||
// Specifies whether or not chat triggers are broadcast to the server or just
|
||||
// the player who requested the info trigger. Valid values are 0 (Disabled) or
|
||||
// 1 (Enabled)
|
||||
// --
|
||||
// Requires: basetriggers.smx
|
||||
// Default: 0
|
||||
sm_trigger_show 0
|
||||
|
||||
// Specifies whether or not to display vote progress to clients in the
|
||||
// "hint" box (near the bottom of the screen in most games).
|
||||
// Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_hintbox 0
|
||||
|
||||
// Specifies whether or not to display vote progress to clients in the
|
||||
// chat area. Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_chat 0
|
||||
|
||||
// Specifies whether or not to display vote progress in the server console.
|
||||
// Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_console 0
|
||||
|
||||
// Specifies whether or not to display vote progress to clients in the
|
||||
// client console. Valid values are 0 (Disabled) or 1 (Enabled).
|
||||
// --
|
||||
// Default: 0
|
||||
sm_vote_progress_client_console 0
|
||||
@@ -0,0 +1,164 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -o nounset
|
||||
set -o errtrace
|
||||
set -o pipefail
|
||||
set -e
|
||||
|
||||
IFS=$'\n\t'
|
||||
ME="$(basename "${0}")"
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
export SCRIPT_DIR=${SCRIPT_DIR%/*}
|
||||
|
||||
usage() {
|
||||
cat <<HEREDOC
|
||||
|
||||
██████╗ ██╗ ██╗██████╗ ███████╗██████╗ ███████╗
|
||||
██╔════╝ ██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝
|
||||
███████╗ ███████║██████╔╝███████╗██║ ██║███████╗
|
||||
██╔═══██╗╚════██║██╔══██╗╚════██║██║ ██║╚════██║
|
||||
╚██████╔╝ ██║██████╔╝███████║██████╔╝███████║
|
||||
╚═════╝ ╚═╝╚═════╝ ╚══════╝╚═════╝ ╚══════╝
|
||||
|
||||
Quick installation of 64-bit Source Dedicated Server
|
||||
|
||||
Requirements: libncurses5 libncurses5:i386 lib32z1
|
||||
|
||||
Usage:
|
||||
./${ME} <css/dods/hl2dm/hldm>
|
||||
|
||||
HEREDOC
|
||||
}
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
usage
|
||||
exit 1
|
||||
else
|
||||
case "$1" in
|
||||
css|dods|hl2dm|hldm)
|
||||
GAMESERVER=$1
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
STEAMCMDBIN="/usr/games/steamcmd"
|
||||
TF2DIR="$HOME/tf2-serverfiles"
|
||||
DSDIR=""
|
||||
|
||||
prepare() {
|
||||
DSDIR="$HOME/$GAMESERVER-serverfiles"
|
||||
|
||||
# Check if steamcmd installed and/or accessible
|
||||
if command -v steamcmd >/dev/null 2&>1; then
|
||||
STEAMCMDBIN=$(command -v steamcmd)
|
||||
elif result=$(find "$HOME" -type f -name 'steamcmd' 2>/dev/null | head -n 1) && [ -n "$result" ]; then
|
||||
STEAMCMDBIN="$result"
|
||||
else
|
||||
echo "SteamCMD not found. Please install following this guide: https://developer.valvesoftware.com/wiki/SteamCMD#Linux"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "SteamCMD found at $STEAMCMDBIN. Continuing..."
|
||||
}
|
||||
|
||||
fetch_server_files() {
|
||||
echo "Starting installation of $GAMESERVER dedicated server!"
|
||||
# Update steamcmd-scripts to correct home dir
|
||||
echo "Confirm steamcmd scripts are correct..."
|
||||
for _steamcmdscriptfile in $SCRIPT_DIR/steamcmd-scripts/*; do
|
||||
sed -i "s#/home/server/#/home/${USER}/#g" "$_steamcmdscriptfile"
|
||||
done
|
||||
|
||||
if [ -d "$DSDIR" ]; then
|
||||
echo "$DSDIR already contains files. Exiting..."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
echo "Starting to download server files using steamcmd"
|
||||
# Fetch required game server and tf2 server files
|
||||
"$STEAMCMDBIN" +runscript "$HOME/steamcmd-scripts/update_${GAMESERVER}_ds.txt" && \
|
||||
echo "$DSDIR successfully downloaded!"
|
||||
|
||||
if [ -d "$TF2DIR" ]; then
|
||||
echo "$TF2DIR already contains files. Validating..."
|
||||
fi
|
||||
"$STEAMCMDBIN" +runscript "$HOME/steamcmd-scripts/update_tf2_ds.txt" && \
|
||||
echo "$TF2DIR successfully downloaded!"
|
||||
}
|
||||
|
||||
copy_64bit() {
|
||||
echo "Copying libsteam_api.so..."
|
||||
cp -a "$TF2DIR/bin/linux64/libsteam_api.so" \
|
||||
"$DSDIR/bin/linux64/."
|
||||
|
||||
echo "Copying srcds binaries..."
|
||||
cp -a "$HOME/tf2-serverfiles/srcds_linux64" "$HOME/tf2-serverfiles/srcds_run_64" \
|
||||
"$DSDIR/."
|
||||
}
|
||||
|
||||
remove_tf2() {
|
||||
echo "Removing $TF2DIR..."
|
||||
[ -f "$DSDIR/srcds_linux64" ] && rm -r "$HOME/tf2-serverfiles" || \
|
||||
# You should never see this message
|
||||
echo "$DSDIR is missing 64-bit binaries. Cannot remove tf2-serverfiles"
|
||||
}
|
||||
|
||||
symlink_binaries() {
|
||||
cd "$DSDIR/bin/linux64"
|
||||
|
||||
for file in *_srv.so; do
|
||||
echo "Symlinking \"$file\" to \"${file/_srv/}"
|
||||
ln -s "$file" "${file/_srv/}"
|
||||
done
|
||||
}
|
||||
|
||||
steamclient_binary() {
|
||||
echo "Looking for steamclient.so and symlinking it..."
|
||||
local _steamclient64bit=$(find "$HOME" -type f -name 'steamclient.so' | grep "linux64" | head -n 1)
|
||||
if [ ! -n $_steamclient64bit ]; then
|
||||
echo "Could not locate 64-bit steamclient.so binary. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.steam/sdk64/" # srcds_linux64 looks for steamclient.so in this directory
|
||||
ln -sf "$_steamclient64bit" "$HOME/.steam/sdk64/steamclient.so"
|
||||
ln -sf "$_steamclient64bit" "$DSDIR/bin/linux64/steamclient.so"
|
||||
}
|
||||
|
||||
main() {
|
||||
prepare
|
||||
fetch_server_files
|
||||
copy_64bit
|
||||
remove_tf2
|
||||
symlink_binaries
|
||||
steamclient_binary
|
||||
|
||||
SRCDSGAME=""
|
||||
case "$GAMESERVER" in
|
||||
css) SRCDSGAME="cstrike"; SRCDSMAP="de_dust2";;
|
||||
dods) SRCDSGAME="dod"; SRCDSMAP="dod_anzio";;
|
||||
hl2dm) SRCDSGAME="hl2mp"; SRCDSMAP="dm_lockdown";;
|
||||
hldm) SRCDSGAME="hl1mp"; SRCDSMAP="crossfire";;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
cat <<SUCESSMSG
|
||||
# --------------------------------------------------- #
|
||||
|
||||
Successfully installed $GAMESERVER dedicated server
|
||||
to $DSDIR!
|
||||
|
||||
Confirm the server starts and runs without issue:
|
||||
$ cd $DSDIR
|
||||
$ ./srcds_run_64 -game $SRCDSGAME +map $SRCDSMAP -debug
|
||||
|
||||
# --------------------------------------------------- #
|
||||
SUCESSMSG
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
# Are we in a metamod container and is the metamod folder missing?
|
||||
if [ ! -z "$METAMOD_VERSION" ] && [ ! -d "${STEAMAPPDIR}/${STEAMAPP}/addons/metamod" ]; then
|
||||
LATESTMM=$(wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/mmsource-latest-linux)
|
||||
wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/"${LATESTMM}" | tar xvzf - -C "${STEAMAPPDIR}/${STEAMAPP}"
|
||||
fi
|
||||
|
||||
# Are we in a sourcemod container and is the sourcemod folder missing?
|
||||
if [ ! -z "$SOURCEMOD_VERSION" ] && [ ! -d "${STEAMAPPDIR}/${STEAMAPP}/addons/sourcemod" ]; then
|
||||
LATESTSM=$(wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/sourcemod-latest-linux)
|
||||
wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/"${LATESTSM}" | tar xvzf - -C "${STEAMAPPDIR}/${STEAMAPP}"
|
||||
fi
|
||||
|
||||
# Is the config missing?
|
||||
if [ -f "${STEAMAPPDIR}/${STEAMAPP}/cfg/server.cfg" ]; then
|
||||
# Change hostname on first launch (you can comment this out if it has done its purpose)
|
||||
sed -i -e 's/{{SERVER_HOSTNAME}}/'"${SRCDS_HOSTNAME}"'/g' "${STEAMAPPDIR}/${STEAMAPP}/cfg/server.cfg"
|
||||
fi
|
||||
|
||||
# Believe it or not, if you don't do this srcds_run shits itself
|
||||
cd "${STEAMAPPDIR}"
|
||||
|
||||
SERVER_SECURITY_FLAG="";
|
||||
|
||||
if [ "$SRCDS_SECURED" -eq 0 ]; then
|
||||
SERVER_SECURITY_FLAG="-insecure";
|
||||
fi
|
||||
|
||||
bash "${STEAMAPPDIR}/srcds_run_64" -game "${STEAMAPP}" -console -autoupdate \
|
||||
-steam_dir "${STEAMCMDDIR}" \
|
||||
-steamcmd_script "${HOMEDIR}/${STEAMAPP}_update.txt" \
|
||||
-usercon \
|
||||
+fps_max "${SRCDS_FPSMAX}" \
|
||||
-tickrate "${SRCDS_TICKRATE}" \
|
||||
-port "${SRCDS_PORT}" \
|
||||
+tv_port "${SRCDS_TV_PORT}" \
|
||||
+clientport "${SRCDS_CLIENT_PORT}" \
|
||||
+maxplayers "${SRCDS_MAXPLAYERS}" \
|
||||
+map "${SRCDS_STARTMAP}" \
|
||||
+sv_setsteamaccount "${SRCDS_TOKEN}" \
|
||||
+rcon_password "${SRCDS_RCONPW}" \
|
||||
+sv_password "${SRCDS_PW}" \
|
||||
+sv_region "${SRCDS_REGION}" \
|
||||
-ip "${SRCDS_IP}" \
|
||||
-authkey "${SRCDS_WORKSHOP_AUTHKEY}" \
|
||||
+servercfgfile "${SRCDS_CFG}" \
|
||||
+mapcyclefile "${SRCDS_MAPCYCLE}" \
|
||||
${SERVER_SECURITY_FLAG}
|
||||
@@ -0,0 +1,93 @@
|
||||
#! /bin/bash
|
||||
|
||||
set -uxe
|
||||
|
||||
update_cssds() {
|
||||
cd $STEAMCMD
|
||||
./steamcmd.sh +runscript "$HOME/etc/update_cssds.txt"
|
||||
|
||||
echo "--------------------------------------------------------------"
|
||||
echo "CSS DS is up to date"
|
||||
echo "--------------------------------------------------------------"
|
||||
}
|
||||
|
||||
update_tf2ds() {
|
||||
cd $STEAMCMD
|
||||
./steamcmd.sh +runscript "$HOME/etc/update_tf2ds.txt"
|
||||
|
||||
echo "--------------------------------------------------------------"
|
||||
echo "TF2 DS is up to date"
|
||||
echo "--------------------------------------------------------------"
|
||||
}
|
||||
|
||||
install_metamod() {
|
||||
# is the metamod folder missing?
|
||||
if [ ! -d "$CSSDS/addons/metamod" ]; then
|
||||
LATESTMM=$(wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/mmsource-latest-linux)
|
||||
wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/"${LATESTMM}" | tar xvzf - -C "$CSSDS"
|
||||
echo "--------------------------------------------------------------"
|
||||
echo "Installed MetaMod $METAMOD_VERSION"
|
||||
echo "--------------------------------------------------------------"
|
||||
fi
|
||||
}
|
||||
|
||||
install_sourcemod() {
|
||||
# Are we in a sourcemod container and is the sourcemod folder missing?
|
||||
if [ ! -d "$CSSDS/addons/sourcemod" ]; then
|
||||
LATESTSM=$(wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/sourcemod-latest-linux)
|
||||
wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/"${LATESTSM}" | tar xvzf - -C "$CSSDS"
|
||||
echo "--------------------------------------------------------------"
|
||||
echo "Installed SourceMod $SOURCEMOD_VERSION"
|
||||
echo "--------------------------------------------------------------"
|
||||
fi
|
||||
}
|
||||
|
||||
copy_64bit() {
|
||||
cp -a "$TF2DS/bin/linux64/libsteam_api.so" \
|
||||
"$CSSDS/bin/linux64/."
|
||||
cp -a "$TF2DS/srcds_linux64" "$TF2DS/srcds_run_64" \
|
||||
"$CSSDS/."
|
||||
}
|
||||
|
||||
symlink_binaries() {
|
||||
cd "$CSSDS/bin/linux64"
|
||||
|
||||
for file in *_srv.so; do
|
||||
echo "Symlinking \"$file\" to \"${file/_srv/}"
|
||||
ln -s "$file" "${file/_srv/}"
|
||||
done
|
||||
}
|
||||
|
||||
steamclient_binary() {
|
||||
echo "Looking for steamclient.so and symlinking it..."
|
||||
local _steamclient64bit=$(find "$HOME" -type f -name 'steamclient.so' | grep "linux64" | head -n 1)
|
||||
if [ ! -n $_steamclient64bit ]; then
|
||||
echo "Could not locate 64-bit steamclient.so binary. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.steam/sdk64/" # srcds_linux64 looks for steamclient.so in this directory
|
||||
ln -nfs "$_steamclient64bit" "$HOME/.steam/sdk64/steamclient.so"
|
||||
ln -nfs "$_steamclient64bit" "$CSSDS/bin/linux64/steamclient.so"
|
||||
}
|
||||
|
||||
run_cssds() {
|
||||
echo "ready to run"
|
||||
cd "$CSSDS"
|
||||
./srcds_run_64 -game cstrike +map de_dust2 -debug
|
||||
}
|
||||
|
||||
main() {
|
||||
update_cssds
|
||||
update_tf2ds
|
||||
copy_64bit
|
||||
symlink_binaries
|
||||
steamclient_binary
|
||||
|
||||
install_metamod
|
||||
install_sourcemod
|
||||
|
||||
run_cssds
|
||||
}
|
||||
|
||||
main
|
||||
@@ -0,0 +1,6 @@
|
||||
@ShutdownOnFailedCommand 1
|
||||
@NoPromptForPassword 1
|
||||
force_install_dir /home/steam/cssds
|
||||
login anonymous
|
||||
app_update 232330 validate
|
||||
quit
|
||||
@@ -0,0 +1,6 @@
|
||||
@ShutdownOnFailedCommand 1
|
||||
@NoPromptForPassword 1
|
||||
force_install_dir /home/steam/tf2ds
|
||||
login anonymous
|
||||
app_update 232250 validate
|
||||
quit
|
||||
Reference in New Issue
Block a user