Compare commits

..

1 Commits

Author SHA1 Message Date
6ff2e51458 remove force-attr and inotify 2020-10-03 01:53:52 +03:00
48 changed files with 70 additions and 232 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.

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,7 +66,7 @@ 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)'
@ -88,7 +87,6 @@ filesystem:
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
@ -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

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.
@ -30,7 +30,7 @@ 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 ()

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,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,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,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,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.
@ -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"

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,5 @@
[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=network-online.target After=network-online.target
Wants=network-online.target Wants=network-online.target
@ -13,7 +12,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,5 @@
[Unit] [Unit]
Description=Killing Floor 2 Server Daemon - %i Description=Killing Floor 2 Server Daemon - %i
Conflicts=kf2-srv-orig@%i.service
After=network-online.target After=network-online.target
Wants=network-online.target Wants=network-online.target
@ -13,7 +12,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.9
Release: 1%{dist} Release: 1%{dist}
Summary: Killing Floor 2 server Summary: Killing Floor 2 server
Group: Amusements/Games Group: Amusements/Games
@ -30,7 +30,6 @@ Requires: gawk
Requires: multini >= 0.2.3 Requires: multini >= 0.2.3
Requires: rsyslog >= 8.25.0 Requires: rsyslog >= 8.25.0
Requires: logrotate Requires: logrotate
Requires: inotify-tools
Requires: bash-completion >= 2.7 Requires: bash-completion >= 2.7
Provides: %{name} Provides: %{name}
@ -68,7 +67,6 @@ 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
@ -101,12 +99,6 @@ if [[ $1 == 1 ]]; then # Install
fi fi
%changelog %changelog
* 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 * Mon Sep 21 2020 GenZmeY <genzmey@gmail.com> - 0.16.0-1
- remove force-attr daemon; - remove force-attr daemon;
- log cmg group; - log cmg group;

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