Compare commits

..

1 Commits

Author SHA1 Message Date
f42bee5885 wip 2020-09-20 20:30:32 +03:00
49 changed files with 175 additions and 304 deletions

View File

@ -1,5 +1,5 @@
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -46,6 +46,7 @@ builddep:
prep: clean-tmp prep: clean-tmp
cd $(SOURCESDIR) && tar czf $(SOURCETARBALL) \ cd $(SOURCESDIR) && tar czf $(SOURCETARBALL) \
config \ config \
force-attr \
main \ main \
COPYING \ COPYING \
Makefile Makefile

View File

@ -1,5 +1,5 @@
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -43,7 +43,6 @@ DATADIR = $(DESTDIR)$(PREFIX)/share
SCRIPTDIR = $(DATADIR)/$(NAME) SCRIPTDIR = $(DATADIR)/$(NAME)
SCRIPTGRPDIR = $(SCRIPTDIR)/cmdgrp SCRIPTGRPDIR = $(SCRIPTDIR)/cmdgrp
SCRIPTLIBDIR = $(SCRIPTDIR)/lib SCRIPTLIBDIR = $(SCRIPTDIR)/lib
SCRIPTPATCHDIR = $(SCRIPTDIR)/patch
LICENSEDIR = $(DATADIR)/licenses/$(NAME) LICENSEDIR = $(DATADIR)/licenses/$(NAME)
KF2MAINDIR = $(GAMEDIR)/$(NAME) KF2MAINDIR = $(GAMEDIR)/$(NAME)
KF2BETADIR = $(GAMEDIR)/$(NAME)-beta KF2BETADIR = $(GAMEDIR)/$(NAME)-beta
@ -67,29 +66,28 @@ build:
fake-systemd-build: fake-systemd-build:
find $(SOURCEDIR)/main -type f -name '*.service' -exec cp -f {} $(RELEASEDIR)/{} \; 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 '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: filesystem:
test -d '$(CONFDIR)' || install -m 775 -d '$(CONFDIR)' test -d '$(CONFDIR)' || install -m 775 -d '$(CONFDIR)'
test -d '$(INSTMAINDIR)' || install -m 775 -d '$(INSTMAINDIR)' test -d '$(INSTMAINDIR)' || install -m 775 -d '$(INSTMAINDIR)'
test -d '$(INSTBETADIR)' || install -m 775 -d '$(INSTBETADIR)' test -d '$(INSTBETADIR)' || install -m 775 -d '$(INSTBETADIR)'
test -d '$(MAPCYCLEDIR)' || install -m 775 -d '$(MAPCYCLEDIR)' test -d '$(MAPCYCLEDIR)' || install -m 775 -d '$(MAPCYCLEDIR)'
test -d '$(CACHEDIR)' || install -m 775 -d '$(CACHEDIR)' test -d '$(CACHEDIR)' || install -m 775 -d '$(CACHEDIR)'
test -d '$(BINDIR)' || install -m 755 -d '$(BINDIR)' test -d '$(BINDIR)' || install -m 755 -d '$(BINDIR)'
test -d '$(SBINDIR)' || install -m 755 -d '$(SBINDIR)' test -d '$(SBINDIR)' || install -m 755 -d '$(SBINDIR)'
test -d '$(KF2MAINDIR)' || install -m 775 -d '$(KF2MAINDIR)' test -d '$(KF2MAINDIR)' || install -m 775 -d '$(KF2MAINDIR)'
test -d '$(KF2BETADIR)' || install -m 775 -d '$(KF2BETADIR)' test -d '$(KF2BETADIR)' || install -m 775 -d '$(KF2BETADIR)'
test -d '$(LICENSEDIR)' || install -m 755 -d '$(LICENSEDIR)' test -d '$(LICENSEDIR)' || install -m 755 -d '$(LICENSEDIR)'
test -d '$(MAINLOGDIR)' || install -m 770 -d '$(MAINLOGDIR)' test -d '$(MAINLOGDIR)' || install -m 770 -d '$(MAINLOGDIR)'
test -d '$(BETALOGDIR)' || install -m 770 -d '$(BETALOGDIR)' test -d '$(BETALOGDIR)' || install -m 770 -d '$(BETALOGDIR)'
test -d '$(UNITDIR)' || install -m 755 -d '$(UNITDIR)' test -d '$(UNITDIR)' || install -m 755 -d '$(UNITDIR)'
test -d '$(FIREWALLDDIR)' || install -m 755 -d '$(FIREWALLDDIR)' test -d '$(FIREWALLDDIR)' || install -m 755 -d '$(FIREWALLDDIR)'
test -d '$(LOGROTATEDIR)' || install -m 755 -d '$(LOGROTATEDIR)' test -d '$(LOGROTATEDIR)' || install -m 755 -d '$(LOGROTATEDIR)'
test -d '$(RSYSLOGDIR)' || install -m 755 -d '$(RSYSLOGDIR)' test -d '$(RSYSLOGDIR)' || install -m 755 -d '$(RSYSLOGDIR)'
test -d '$(SCRIPTGRPDIR)' || install -m 755 -d '$(SCRIPTGRPDIR)' test -d '$(SCRIPTGRPDIR)' || install -m 755 -d '$(SCRIPTGRPDIR)'
test -d '$(SCRIPTLIBDIR)' || install -m 755 -d '$(SCRIPTLIBDIR)' test -d '$(SCRIPTLIBDIR)' || install -m 755 -d '$(SCRIPTLIBDIR)'
test -d '$(SCRIPTPATCHDIR)' || install -m 755 -d '$(SCRIPTPATCHDIR)' test -d '$(BASHCOMPDIR)' || install -m 755 -d '$(BASHCOMPDIR)'
test -d '$(BASHCOMPDIR)' || install -m 755 -d '$(BASHCOMPDIR)'
install: filesystem build install: filesystem build
install -m 755 $(RELEASEDIR)/main/$(NAME) $(BINDIR) install -m 755 $(RELEASEDIR)/main/$(NAME) $(BINDIR)
@ -112,9 +110,7 @@ install: filesystem build
install -m 644 $(RELEASEDIR)/main/lib/* $(SCRIPTLIBDIR) install -m 644 $(RELEASEDIR)/main/lib/* $(SCRIPTLIBDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)@.service $(UNITDIR) 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@.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.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer $(UNITDIR) install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-update.service $(UNITDIR) install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-update.service $(UNITDIR)
@ -137,9 +133,7 @@ uninstall:
rm -f $(BINDIR)/$(NAME)-beta rm -f $(BINDIR)/$(NAME)-beta
rm -f $(UNITDIR)/$(NAME)@.service rm -f $(UNITDIR)/$(NAME)@.service
rm -f $(UNITDIR)/$(NAME)-orig@.service
rm -f $(UNITDIR)/$(NAME)-beta@.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.service
rm -f $(UNITDIR)/$(NAME)-beta-update.timer rm -f $(UNITDIR)/$(NAME)-beta-update.timer
rm -f $(UNITDIR)/$(NAME)-update.service rm -f $(UNITDIR)/$(NAME)-update.service
@ -158,9 +152,7 @@ test: fake-systemd-build
$(XMLCHECK) $(RELEASEDIR)/main/firewalld/$(NAME).xml $(XMLCHECK) $(RELEASEDIR)/main/firewalld/$(NAME).xml
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)@.service $(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@.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-orig@.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.service $(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.service
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer $(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.timer
$(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-update.service $(SYSTEMDCHECK) $(RELEASEDIR)/main/systemd/$(NAME)-update.service

View File

@ -1,67 +0,0 @@
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

54
SOURCES/loggrind/loggrind Normal file
View File

@ -0,0 +1,54 @@
#!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com
#
# This file is part of kf2-srv.
#
# kf2-srv is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
readonly ScriptFullname=$(readlink -e "$0")
readonly ScriptName=$(basename $0)
function show_help ()
{
echo "$ScriptName <service_name> <status_dir>"
}
function grind () # $1: Line
{
}
if [[ $# -ne 2 ]]; then show_help; exit 0; fi
StatusDir=$(readlink -e "$2")
if echo "$1" | grep -P '\.service$'; then
Service="$1"
Name="$1.service"
else
Service="$1.service"
Name="$1"
fi
#if ! [[ -e "$StatusDir/$Name" ]]; then
# READ?
#fi
while read Line
do
grind "$Line"
done < journalctl -f --no-pager -o json --output-fields=MESSAGE -u "$Service" | jq -r '.MESSAGE'

View File

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

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,8 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "Id can be SteamID3, SteamID64 or a link to a user profile." echo "TODO: description"
echo "EGS players are not supported."
} }
function cmd_main () # $*: ban list function cmd_main () # $*: ban list

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -30,13 +30,12 @@ function cmd_usage ()
function cmd_info () function cmd_info ()
{ {
echo "Remove the specified user(s) from the blocklist" echo "remove the specified user(s) from the blocklist"
} }
function cmd_help () function cmd_help ()
{ {
echo "Id can be SteamID3, SteamID64 or a link to a user profile." echo "TODO: description"
echo "EGS players are not supported."
} }
function cmd_main () # $*: ban list function cmd_main () # $*: ban list

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -33,10 +33,10 @@ function cmd_info ()
echo "Show the list of blocked users" echo "Show the list of blocked users"
} }
#function cmd_help () function cmd_help ()
#{ {
# echo "" echo "TODO: description"
#} }
function cmd_main () function cmd_main ()
{ {

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -33,10 +33,10 @@ function cmd_info ()
echo "Sync blocklist for all servers" echo "Sync blocklist for all servers"
} }
#function cmd_help () function cmd_help ()
#{ {
# echo "" echo "TODO: description"
#} }
function cmd_main () function cmd_main ()
{ {

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,10 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "By default, all files created by the kf2 server" echo "TODO: description"
echo "have 600 permissions, which can be inconvenient."
echo "This command fixes the permissions and groups of"
echo "all ini files to the values specified in kf2-srv.conf"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "Run the server binary directly, without systemd or anything else." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,8 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "Stops all running server instances, installs updates (if any)" echo "TODO: description"
echo "When finished, starts all enabled instances."
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,8 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "Stops all running server instances, validate server files." echo "TODO: description"
echo "When finished, starts all enabled instances."
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "Name(s) must not contain spaces." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info () function cmd_info ()
{ {
echo "Send message to specified server instance(s)" echo "Send message to specified server instances"
} }
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, sends a message to all running servers." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info () function cmd_info ()
{ {
echo "Delete the specified server instance(s)" echo "Delete the specified server instances"
} }
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, deletes all server instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info () function cmd_info ()
{ {
echo "Disable autostart for specified server instance(s)" echo "Disable specified server instance(s)"
} }
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, disable autostart for all instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info () function cmd_info ()
{ {
echo "Enable autostart for specified server instance(s)" echo "Enable specified server instance(s)"
} }
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, disable autostart for all instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, displays the status of all instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, restarts all enabled instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, starts all enabled instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, stops all instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, prints the log of all instances." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, prints the log of all instances in real time." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, load map rotation for all instances." echo "TODO: description"
} }
function cmd_main () # $*: Instance[s] function cmd_main () # $*: Instance[s]

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, save map rotation for all instances." echo "TODO: description"
} }
function cmd_main () # $*: Instance[s] function cmd_main () # $*: Instance[s]

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,9 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, set a admin password for all instances." echo "TODO: description"
echo "To remove a password, use an empty password as an argument,"
echo "example: ${ScriptFullname}${KF2POSTFIX} password admin '' test_instance"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,9 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "If instance is not specified, set a game password for all instances." echo "TODO: description"
echo "To remove a password, use an empty password as an argument,"
echo "example: ${ScriptFullname}${KF2POSTFIX} password game '' test_instance"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -25,7 +25,7 @@ cmd_need_installed_server () { false ;}
function cmd_usage () function cmd_usage ()
{ {
echo "<workshop_id>..." echo "[<workshop_id>...]"
} }
function cmd_info () function cmd_info ()
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "workshop_id can be a resource ID or a link to a resource in workshop." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help () function cmd_help ()
{ {
echo "workshop_id can be a resource ID or a link to a resource in workshop." echo "TODO: description"
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -33,10 +33,10 @@ function cmd_info ()
echo "Show the list of steam workshop resources" echo "Show the list of steam workshop resources"
} }
#function cmd_help () function cmd_help ()
#{ {
# echo "" echo "TODO: description"
#} }
function cmd_main () function cmd_main ()
{ {

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -30,13 +30,12 @@ function cmd_usage ()
function cmd_info () function cmd_info ()
{ {
echo "Sync steam workshop resources between all server instances" echo "Sync steamorkshop resources between all server instances"
} }
function cmd_help () function cmd_help ()
{ {
echo "In addition to synchronization, adds loaded maps and mutators to KFGame.ini." echo "TODO: description"
echo "This command works for stopped server instances only."
} }
function cmd_main () function cmd_main ()

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -25,11 +25,9 @@ readonly ScriptVersion=$(rpm -q --queryformat '%{VERSION}' "$ScriptName")
readonly GrpDir=":DEFINE_PREFIX:/share/kf2-srv/cmdgrp" readonly GrpDir=":DEFINE_PREFIX:/share/kf2-srv/cmdgrp"
readonly LibDir=":DEFINE_PREFIX:/share/kf2-srv/lib" 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 InstallDir=":DEFINE_PREFIX:/games/kf2-srv${KF2POSTFIX}"
readonly AppBin="$InstallDir/Binaries/Win64/KFGameSteamServer.bin.x86_64" readonly AppBin="$InstallDir/Binaries/Win64/KFGameSteamServer.bin.x86_64"
readonly AppBinOrig="${AppBin}.orig"
readonly DefaultConfigDir="$InstallDir/KFGame/Config" readonly DefaultConfigDir="$InstallDir/KFGame/Config"
readonly DefaultDownloadDir="$InstallDir/Binaries/Win64/steamapps/workshop" readonly DefaultDownloadDir="$InstallDir/Binaries/Win64/steamapps/workshop"
@ -199,22 +197,10 @@ elif [[ -d "$GroupPathname" ]]; then
shift shift
source "$CommandPathName" source "$CommandPathName"
if is_help "$1"; then if is_help "$1"; then
if ! function_exists "cmd_usage" \ if function_exists "cmd_help"; then
&& ! function_exists "cmd_info" \ cmd_help
&& ! function_exists "cmd_help"; then
echo "No help page for this command."
else else
if function_exists "cmd_usage"; then echo "No help page for this command."
echo "usage: $(cmd_usage)"
echo
fi
if function_exists "cmd_info"; then
cmd_info
echo
fi
if function_exists "cmd_help"; then
cmd_help
fi
fi fi
elif is_usage "$1"; then elif is_usage "$1"; then
if function_exists "cmd_usage"; then if function_exists "cmd_usage"; then

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# kf2-srv is a command line tool for managing a set of Killing Floor 2 servers. # kf2-srv is a command line tool for managing a set of Killing Floor 2 servers.
# Copyright (C) 2019-2021 GenZmeY # Copyright (C) 2019, 2020 GenZmeY
# mailto: genzmey@gmail.com # mailto: genzmey@gmail.com
# #
# This file is part of kf2-srv. # This file is part of kf2-srv.
@ -60,7 +60,6 @@ function game_update ()
elif updates_aviable; then elif updates_aviable; then
instance_stop instance_stop
steamcmd +login $SteamLogin +force_install_dir $InstallDir +app_update $AppServerNum $BetaArg +exit steamcmd +login $SteamLogin +force_install_dir $InstallDir +app_update $AppServerNum $BetaArg +exit
apply_patch
instance_start instance_start
else else
echo "Server is up to date" echo "Server is up to date"
@ -97,7 +96,6 @@ function game_validate ()
fi fi
instance_stop instance_stop
steamcmd +login $SteamLogin +force_install_dir $InstallDir +app_update $AppServerNum $BetaArg validate +exit steamcmd +login $SteamLogin +force_install_dir $InstallDir +app_update $AppServerNum $BetaArg validate +exit
apply_patch
fix_steamclient_so fix_steamclient_so
instance_start instance_start
} }
@ -202,7 +200,6 @@ function first_install ()
fix_steamclient_so fix_steamclient_so
ln -s "$InstanceConfigDir" "$DefaultConfigDir/instances" ln -s "$InstanceConfigDir" "$DefaultConfigDir/instances"
make_default_instance make_default_instance
apply_patch
echo "KF2 succesfully installed" echo "KF2 succesfully installed"
} }
@ -278,15 +275,6 @@ function make_default_instance () # $1: Dir
fix_ini_eol "$InstanceDir" 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 function fix_ini_eol () # $1: Dir
{ {
find "$1" \( -type l -o -type f \) -name '*.ini' | \ find "$1" \( -type l -o -type f \) -name '*.ini' | \

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,25 +0,0 @@
[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] [Unit]
Description=Killing Floor 2 Beta Server Daemon - %i Description=Killing Floor 2 Beta Server Daemon - %i
Conflicts=kf2-srv-beta-orig@%i.service After=kf2-srv-force-attr.service
After=network-online.target After=network-online.target
Wants=network-online.target Wants=network-online.target
@ -13,7 +13,7 @@ StandardError=syslog
SyslogIdentifier=kf2-srv-beta/%i SyslogIdentifier=kf2-srv-beta/%i
EnvironmentFile=/etc/kf2-srv/instances-beta/%i/instance.conf 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} 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=on-failure Restart=always
NoNewPrivileges=yes NoNewPrivileges=yes
PrivateTmp=true PrivateTmp=true

View File

@ -1,25 +0,0 @@
[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] [Unit]
Description=Killing Floor 2 Server Daemon - %i Description=Killing Floor 2 Server Daemon - %i
Conflicts=kf2-srv-orig@%i.service After=kf2-srv-force-attr.service
After=network-online.target After=network-online.target
Wants=network-online.target Wants=network-online.target
@ -13,7 +13,7 @@ StandardError=syslog
SyslogIdentifier=kf2-srv/%i SyslogIdentifier=kf2-srv/%i
EnvironmentFile=/etc/kf2-srv/instances/%i/instance.conf 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} 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=on-failure Restart=always
NoNewPrivileges=yes NoNewPrivileges=yes
PrivateTmp=true PrivateTmp=true

View File

@ -1,7 +1,7 @@
%global steamuser steam %global steamuser steam
Name: kf2-srv Name: kf2-srv
Version: 0.17.1 Version: 0.15.8
Release: 1%{dist} Release: 1%{dist}
Summary: Killing Floor 2 server Summary: Killing Floor 2 server
Group: Amusements/Games Group: Amusements/Games
@ -68,13 +68,13 @@ rm -rf $RPM_BUILD_ROOT
%attr(0775,root,root) %dir %{_datadir}/%{name}/cmdgrp %attr(0775,root,root) %dir %{_datadir}/%{name}/cmdgrp
%attr(0755,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}/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}/instance.conf.template
%attr(0664,root,%{steamuser}) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %attr(0664,root,%{steamuser}) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%attr(0640,root,%{steamuser}) %config(noreplace) %{_sysconfdir}/%{name}/bot.conf %attr(0640,root,%{steamuser}) %config(noreplace) %{_sysconfdir}/%{name}/bot.conf
%attr(0644,root,root) %config(noreplace) %{_prefix}/lib/firewalld/services/%{name}.xml %attr(0644,root,root) %config(noreplace) %{_prefix}/lib/firewalld/services/%{name}.xml
%attr(0755,root,root) %{_bindir}/%{name} %attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{name}-beta %attr(0755,root,root) %{_bindir}/%{name}-beta
%attr(0755,root,root) %{_sbindir}/%{name}-force-attr
%attr(0644,root,root) %{_unitdir}/* %attr(0644,root,root) %{_unitdir}/*
%attr(0644,root,root) %doc %{_datadir}/licenses/%{name}/* %attr(0644,root,root) %doc %{_datadir}/licenses/%{name}/*
%attr(0644,root,root) %{_sysconfdir}/rsyslog.d/%{name}.conf %attr(0644,root,root) %{_sysconfdir}/rsyslog.d/%{name}.conf
@ -101,16 +101,8 @@ if [[ $1 == 1 ]]; then # Install
fi fi
%changelog %changelog
* Sat Feb 27 2021 GenZmeY <genzmey@gmail.com> - 0.17.1-1 * Tue Sep 8 2020 GenZmeY <genzmey@gmail.com> - 0.16.0-1
- fix the start of the original app. - log cmg group.
* 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;
- command descriptions.
* Sat Aug 15 2020 GenZmeY <genzmey@gmail.com> - 0.15.4-1 * Sat Aug 15 2020 GenZmeY <genzmey@gmail.com> - 0.15.4-1
- fixed broken update; - fixed broken update;

4
TODO
View File

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