Compare commits

..

No commits in common. "0.16.0-1" and "master" have entirely different histories.

51 changed files with 297 additions and 105 deletions

View File

@ -1,5 +1,5 @@
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,24 +1,33 @@
# kf2-srv
# KF2-SRV
*Killing Floor 2 server tool for RHEL8/CentOS8*
[![build release](https://github.com/GenZmeY/kf2-srv/workflows/build%20release/badge.svg)](https://github.com/GenZmeY/kf2-srv/actions?query=workflow%3A%22build+release%22)
[![tests (master)](https://github.com/GenZmeY/kf2-srv/workflows/tests%20(master)/badge.svg?branch=master)](https://github.com/GenZmeY/kf2-srv/actions?query=workflow%3A%22tests+%28master%29%22)
[![tests (dev)](https://github.com/GenZmeY/kf2-srv/workflows/tests%20(dev)/badge.svg?branch=dev)](https://github.com/GenZmeY/kf2-srv/actions?query=workflow%3A%22tests+%28dev%29%22)
[![GitHub release](https://img.shields.io/github/v/release/genzmey/kf2-srv)](https://github.com/genzmey/kf2-srv/releases/latest)
[![GitHub Release Date](https://img.shields.io/github/release-date/genzmey/kf2-srv)](https://github.com/genzmey/kf2-srv/releases/latest)
[![build release](https://github.com/GenZmeY/KF2-SRV/workflows/build%20release/badge.svg)](https://github.com/GenZmeY/KF2-SRV/actions?query=workflow%3A%22build+release%22)
[![tests (master)](https://github.com/GenZmeY/KF2-SRV/workflows/tests%20(master)/badge.svg?branch=master)](https://github.com/GenZmeY/KF2-SRV/actions?query=workflow%3A%22tests+%28master%29%22)
[![GitHub release](https://img.shields.io/github/v/release/genzmey/KF2-SRV)](https://github.com/genzmey/KF2-SRV/releases/latest)
[![GitHub Release Date](https://img.shields.io/github/release-date/genzmey/KF2-SRV)](https://github.com/genzmey/KF2-SRV/releases/latest)
![GitHub](https://img.shields.io/github/license/genzmey/KF2-SRV)
# Features
...
# Build
...
# Install
...
# Warning
There is not and most likely never will be a detailed manual. If you don't have sufficient knowledge of Linux in general and CentOS in particular, as well as the ability to learn unknown tools, you probably shouldn't use this.
# Usage
...
You can find actual rpm packages here(\*): https://github.com/GenZmeY/KF2-SRV/releases
And dependencies here: https://cloud.genzmey.su/index.php/s/3GiwtDpkNyCarXc
Basic usage information: https://github.com/GenZmeY/KF2-SRV/blob/master/SOURCES/README
\* inotify-tools requirement can be ignored
- Install packages `steamcmd-2018.01.05-5.el8.x86_64.rpm`, `multini-0.4.3-1.el8.x86_64.rpm`, `kf2-srv-0.18.1-1.el8.noarch.rpm`
- `kf2-srv game update` or `kf2-srv-beta game update`
- use `kf2-srv --help` or `kf2-srv <COMMAND> --help` to see the actions available to you and decide what to do next
**Filesystem:**
configs: `/etc/kf2-srv/`
game server: `/usr/games/kf2-srv`
game server (beta): `/usr/games/kf2-srv-beta`
cache: `/var/cache/kf2-srv`
logs: `/var/log/kf2-srv`
logs (beta): `/var/logs/kf2-srv`
# License
![GitHub](https://img.shields.io/github/license/genzmey/kf2-srv)
...
[GNU GPLv3](LICENSE)

View File

@ -1,5 +1,5 @@
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.
@ -43,6 +43,7 @@ DATADIR = $(DESTDIR)$(PREFIX)/share
SCRIPTDIR = $(DATADIR)/$(NAME)
SCRIPTGRPDIR = $(SCRIPTDIR)/cmdgrp
SCRIPTLIBDIR = $(SCRIPTDIR)/lib
SCRIPTPATCHDIR = $(SCRIPTDIR)/patch
LICENSEDIR = $(DATADIR)/licenses/$(NAME)
KF2MAINDIR = $(GAMEDIR)/$(NAME)
KF2BETADIR = $(GAMEDIR)/$(NAME)-beta
@ -66,7 +67,7 @@ build:
fake-systemd-build:
find $(SOURCEDIR)/main -type f -name '*.service' -exec cp -f {} $(RELEASEDIR)/{} \;
find $(RELEASEDIR) -type f -exec sed -i 's|:DEFINE_PREFIX:|$(DESTDIR)$(PREFIX)|g;' {} \;
find $(RELEASEDIR) -type f -exec sed -i -r 's|ExecStart=.+KFGameSteamServer.bin.x86_64|ExecStart=/bin/bash|g;' {} \;
find $(RELEASEDIR) -type f -exec sed -i -r 's|ExecStart=.+KFGameSteamServer.bin.x86_64.*|ExecStart=/bin/bash|g;' {} \;
filesystem:
test -d '$(CONFDIR)' || install -m 775 -d '$(CONFDIR)'
@ -87,6 +88,7 @@ filesystem:
test -d '$(RSYSLOGDIR)' || install -m 755 -d '$(RSYSLOGDIR)'
test -d '$(SCRIPTGRPDIR)' || install -m 755 -d '$(SCRIPTGRPDIR)'
test -d '$(SCRIPTLIBDIR)' || install -m 755 -d '$(SCRIPTLIBDIR)'
test -d '$(SCRIPTPATCHDIR)' || install -m 755 -d '$(SCRIPTPATCHDIR)'
test -d '$(BASHCOMPDIR)' || install -m 755 -d '$(BASHCOMPDIR)'
install: filesystem build
@ -110,7 +112,9 @@ install: filesystem build
install -m 644 $(RELEASEDIR)/main/lib/* $(SCRIPTLIBDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)@.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-orig@.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta@.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-orig@.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-update.service $(UNITDIR)
@ -133,7 +137,9 @@ uninstall:
rm -f $(BINDIR)/$(NAME)-beta
rm -f $(UNITDIR)/$(NAME)@.service
rm -f $(UNITDIR)/$(NAME)-orig@.service
rm -f $(UNITDIR)/$(NAME)-beta@.service
rm -f $(UNITDIR)/$(NAME)-beta-orig@.service
rm -f $(UNITDIR)/$(NAME)-beta-update.service
rm -f $(UNITDIR)/$(NAME)-beta-update.timer
rm -f $(UNITDIR)/$(NAME)-update.service
@ -152,7 +158,9 @@ test: fake-systemd-build
$(XMLCHECK) $(RELEASEDIR)/main/firewalld/$(NAME).xml
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)@.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-orig@.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta@.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-orig@.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-update.service

67
SOURCES/README Normal file
View File

@ -0,0 +1,67 @@
kf2-srv
Command line tool for managing a set of Killing Floor 2 servers.
Usage: kf2-srv <group> <command> [<args>]
kf2-srv ban add <id>...
Add the specified user(s) to the blocklist
kf2-srv ban delete <id>...
remove the specified user(s) from the blocklist
kf2-srv ban list
Show the list of blocked users
kf2-srv ban sync
Sync blocklist for all servers
kf2-srv game fix-permissions [<instance>...]
Correct ini files permissions for the specified instance
kf2-srv game run [<args>...]
Start the server with the specified parameters
kf2-srv game update
Install or update the server
kf2-srv game validate
Check the integrity of files, update them if necessary
kf2-srv instance add <name>...
Create a new server instance(s) with the specified name(s)
kf2-srv instance chat <message> [<instance>...]
Send message to specified server instance(s)
kf2-srv instance delete [<instance>...]
Delete the specified server instance(s)
kf2-srv instance disable [<instance>...]
Disable autostart for specified server instance(s)
kf2-srv instance enable [<instance>...]
Enable autostart for specified server instance(s)
kf2-srv instance list [<instance>...]
Show status of the specified server instance(s)
kf2-srv instance restart [<instance>...]
Restart the specified server instance(s)
kf2-srv instance start [<instance>...]
Start the specified server instance(s)
kf2-srv instance stop [<instance>...]
Stop the specified server instance(s)
kf2-srv log cat [<instance>...]
Print in stdout full log of specified server instance(s)
kf2-srv log tail [<instance>...]
Print in stdout tail log of specified server instance(s) in real time
kf2-srv maprotate load [<instance>...]
Load map rotation for specified server instance(s)
kf2-srv maprotate save [<instance>...]
Save map rotation for specified server instance(s)
kf2-srv password admin <password> [<instance>...]
Set a admin password for the specified server instance(s)
kf2-srv password game <password> [<instance>...]
Set a game password for the specified server instance(s)
kf2-srv workshop add <workshop_id>...
Add specified resource(s) from steam workshop
kf2-srv workshop delete [<workshop_id>...]
Delete specified steam workshop resource(s)
kf2-srv workshop list
Show the list of steam workshop resources
kf2-srv workshop sync
Sync steam workshop resources between all server instances
Use --help as an argument for information on a specific group or command

View File

@ -29,3 +29,6 @@ MutNames['ZedCustom.ZedCustomMut']='ZedVarients'
IniPermissions=664
IniGroup=steam
# if true all steamclient.so will be replaced by symlinks to:
# /usr/games/steamcmd/linux64/steamclient.so
FixSteamclientLib=True

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.
@ -30,7 +30,7 @@ function cmd_usage ()
function cmd_info ()
{
echo "remove the specified user(s) from the blocklist"
echo "Remove the specified user(s) from the blocklist"
}
function cmd_help ()

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.
@ -25,9 +25,11 @@ readonly ScriptVersion=$(rpm -q --queryformat '%{VERSION}' "$ScriptName")
readonly GrpDir=":DEFINE_PREFIX:/share/kf2-srv/cmdgrp"
readonly LibDir=":DEFINE_PREFIX:/share/kf2-srv/lib"
readonly PatchDir=":DEFINE_PREFIX:/share/kf2-srv/patch"
readonly InstallDir=":DEFINE_PREFIX:/games/kf2-srv${KF2POSTFIX}"
readonly AppBin="$InstallDir/Binaries/Win64/KFGameSteamServer.bin.x86_64"
readonly AppBinOrig="${AppBin}.orig"
readonly DefaultConfigDir="$InstallDir/KFGame/Config"
readonly DefaultDownloadDir="$InstallDir/Binaries/Win64/steamapps/workshop"

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.
@ -60,6 +60,7 @@ function game_update ()
elif updates_aviable; then
instance_stop
steamcmd +login $SteamLogin +force_install_dir $InstallDir +app_update $AppServerNum $BetaArg +exit
apply_patch
instance_start
else
echo "Server is up to date"
@ -95,8 +96,10 @@ function game_validate ()
local BetaArg="-beta preview"
fi
instance_stop
remove_symlink_steamclient_so
steamcmd +login $SteamLogin +force_install_dir $InstallDir +app_update $AppServerNum $BetaArg validate +exit
fix_steamclient_so
apply_patch
create_symlink_steamclient_so
instance_start
}
@ -105,6 +108,8 @@ function first_install ()
include /etc/steamcmd/steamcmd.conf
include /etc/kf2-srv/bot.conf
remove_symlink_steamclient_so
if ! steamcmd +login $SteamLogin +force_install_dir $InstallDir +app_update $AppServerNum $BetaArg validate +exit; then
echo "Errors during installation - exit"
exit 1
@ -197,9 +202,10 @@ function first_install ()
killall -KILL KFGameSteamServer.bin.x86_64; sleep 1
create_cache
fix_steamclient_so
create_symlink_steamclient_so
ln -s "$InstanceConfigDir" "$DefaultConfigDir/instances"
make_default_instance
apply_patch
echo "KF2 succesfully installed"
}
@ -238,14 +244,30 @@ function create_cache ()
fi
}
function fix_steamclient_so ()
function remove_symlink_steamclient_so ()
{
include /etc/kf2-srv/kf2-srv.conf
if echo "$FixSteamclientLib" | grep -qiF 'true'; then
rm -f "$InstallDir/linux64/steamclient.so"
rm -f "$InstallDir/steamclient.so"
rm -f "$InstallDir/Binaries/Win64/lib64/steamclient.so"
else
test -L "$InstallDir/linux64/steamclient.so" && rm -f "$InstallDir/linux64/steamclient.so"
test -L "$InstallDir/steamclient.so" && rm -f "$InstallDir/steamclient.so"
test -L "$InstallDir/Binaries/Win64/lib64/steamclient.so" && rm -f "$InstallDir/Binaries/Win64/lib64/steamclient.so"
fi
}
function create_symlink_steamclient_so ()
{
include /etc/kf2-srv/kf2-srv.conf
if echo "$FixSteamclientLib" | grep -qiF 'true'; then
ln -s "/usr/games/steamcmd/linux64/steamclient.so" "$InstallDir/linux64/steamclient.so"
ln -s "/usr/games/steamcmd/linux64/steamclient.so" "$InstallDir/steamclient.so"
ln -s "/usr/games/steamcmd/linux64/steamclient.so" "$InstallDir/Binaries/Win64/lib64/steamclient.so"
fi
}
function make_default_instance () # $1: Dir
@ -275,6 +297,15 @@ function make_default_instance () # $1: Dir
fix_ini_eol "$InstanceDir"
}
function apply_patch ()
{
if [[ -x "$PatchDir/kf2-ranked-patch" ]]; then
"$PatchDir/kf2-ranked-patch" "$AppBin" "$AppBinOrig"
chmod +x "$AppBin" "$AppBinOrig"
chown "$SteamUser:$SteamUser" "$AppBin" "$AppBinOrig"
fi
}
function fix_ini_eol () # $1: Dir
{
find "$1" \( -type l -o -type f \) -name '*.ini' | \

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.
@ -45,6 +45,21 @@ function service_name () # $*: Instance[s]
local Services=""
for Instance in $*
do
if multini -g "$InstanceConfigDir/$Instance/instance.conf" '' "UseOrigApp" 2> /dev/null | grep -Piqo '^True$' && test -x "$AppBinOrig"; then
Services+=" kf2-srv${KF2POSTFIX}-orig@$Instance.service"
else
Services+=" kf2-srv${KF2POSTFIX}@$Instance.service"
fi
done
echo "$Services"
}
function service_names () # $*: Instance[s]
{
local Services=""
for Instance in $*
do
Services+=" kf2-srv${KF2POSTFIX}-orig@$Instance.service"
Services+=" kf2-srv${KF2POSTFIX}@$Instance.service"
done
echo "$Services"
@ -212,7 +227,7 @@ function instance_disable () # $*: [InstanceName[s]]
done
if [[ -n "$ToDisableInstanceList" ]]; then
systemctl disable $(service_name "$ToDisableInstanceList")
systemctl disable $(service_names "$ToDisableInstanceList")
else
echo "Nothing to do"
fi
@ -409,7 +424,7 @@ function instance_stop () # $*: [InstanceName[s]]
done
if [[ -n "$ToStopInstanceList" ]]; then
systemctl stop $(service_name "$ToStopInstanceList")
systemctl stop $(service_names "$ToStopInstanceList")
else
echo "Nothing to do"
fi

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# Copyright (C) 2019-2021 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.

View File

@ -0,0 +1,25 @@
[Unit]
Description=Killing Floor 2 Beta Server Daemon - %i
Conflicts=kf2-srv-beta@%i.service
After=network-online.target
Wants=network-online.target
[Service]
User=steam
Group=steam
Type=simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=kf2-srv-beta/%i
EnvironmentFile=/etc/kf2-srv/instances-beta/%i/instance.conf
ExecStart=:DEFINE_PREFIX:/games/kf2-srv-beta/Binaries/Win64/KFGameSteamServer.bin.x86_64.orig ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
Restart=on-failure
NoNewPrivileges=yes
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=false
[Install]
WantedBy=multi-user.target

View File

@ -1,6 +1,6 @@
[Unit]
Description=Killing Floor 2 Beta Server Daemon - %i
After=kf2-srv-force-attr.service
Conflicts=kf2-srv-beta-orig@%i.service
After=network-online.target
Wants=network-online.target
@ -13,7 +13,7 @@ StandardError=syslog
SyslogIdentifier=kf2-srv-beta/%i
EnvironmentFile=/etc/kf2-srv/instances-beta/%i/instance.conf
ExecStart=:DEFINE_PREFIX:/games/kf2-srv-beta/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
Restart=always
Restart=on-failure
NoNewPrivileges=yes
PrivateTmp=true

View File

@ -0,0 +1,25 @@
[Unit]
Description=Killing Floor 2 Server Daemon - %i
Conflicts=kf2-srv@%i.service
After=network-online.target
Wants=network-online.target
[Service]
User=steam
Group=steam
Type=simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=kf2-srv/%i
EnvironmentFile=/etc/kf2-srv/instances/%i/instance.conf
ExecStart=:DEFINE_PREFIX:/games/kf2-srv/Binaries/Win64/KFGameSteamServer.bin.x86_64.orig ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
Restart=on-failure
NoNewPrivileges=yes
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=false
[Install]
WantedBy=multi-user.target

View File

@ -1,6 +1,6 @@
[Unit]
Description=Killing Floor 2 Server Daemon - %i
After=kf2-srv-force-attr.service
Conflicts=kf2-srv-orig@%i.service
After=network-online.target
Wants=network-online.target
@ -13,7 +13,7 @@ StandardError=syslog
SyslogIdentifier=kf2-srv/%i
EnvironmentFile=/etc/kf2-srv/instances/%i/instance.conf
ExecStart=:DEFINE_PREFIX:/games/kf2-srv/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
Restart=always
Restart=on-failure
NoNewPrivileges=yes
PrivateTmp=true

View File

@ -1,7 +1,7 @@
%global steamuser steam
Name: kf2-srv
Version: 0.16.0
Version: 0.18.1
Release: 1%{dist}
Summary: Killing Floor 2 server
Group: Amusements/Games
@ -68,6 +68,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(0775,root,root) %dir %{_datadir}/%{name}/cmdgrp
%attr(0755,root,root) %dir %{_datadir}/%{name}/cmdgrp/*
%attr(0775,root,root) %dir %{_datadir}/%{name}/lib
%attr(0775,root,root) %dir %{_datadir}/%{name}/patch
%attr(0664,root,%{steamuser}) %config(noreplace) %{_sysconfdir}/%{name}/instance.conf.template
%attr(0664,root,%{steamuser}) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%attr(0640,root,%{steamuser}) %config(noreplace) %{_sysconfdir}/%{name}/bot.conf
@ -100,6 +101,18 @@ if [[ $1 == 1 ]]; then # Install
fi
%changelog
* Tue Jun 22 2021 GenZmeY <genzmey@gmail.com> - 0.18.1-1
- fix "FixSteamclientLib" setting.
* Tue Jun 22 2021 GenZmeY <genzmey@gmail.com> - 0.18.0-1
- add FixSteamclientLib setting to config.
* Sat Feb 27 2021 GenZmeY <genzmey@gmail.com> - 0.17.1-1
- fix the start of the original app.
* Sun Feb 21 2021 GenZmeY <genzmey@gmail.com> - 0.17.0-1
- binary patching support.
* Mon Sep 21 2020 GenZmeY <genzmey@gmail.com> - 0.16.0-1
- remove force-attr daemon;
- log cmg group;

10
TODO
View File

@ -1,10 +0,0 @@
- selinux
- sudo for steamuser
- kick by level
- man pages
- write help pages for each command
- check ban EGS players (mb bugs)
- ban history
- temporary ban
- generate unique password for server bot on install

4
TODO.md Normal file
View File

@ -0,0 +1,4 @@
# TODO:
- [ ] split source and rpmbuild
- [ ] add shellcheck
- [ ] webadmin patch