Compare commits

..

1 Commits

Author SHA1 Message Date
f42bee5885 wip 2020-09-20 20:30:32 +03:00
33 changed files with 107 additions and 74 deletions

View File

@ -46,6 +46,7 @@ builddep:
prep: clean-tmp
cd $(SOURCESDIR) && tar czf $(SOURCETARBALL) \
config \
force-attr \
main \
COPYING \
Makefile

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

@ -35,8 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "Id can be SteamID3, SteamID64 or a link to a user profile."
echo "EGS players are not supported."
echo "TODO: description"
}
function cmd_main () # $*: ban list

View File

@ -35,8 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "Id can be SteamID3, SteamID64 or a link to a user profile."
echo "EGS players are not supported."
echo "TODO: description"
}
function cmd_main () # $*: ban list

View File

@ -33,10 +33,10 @@ function cmd_info ()
echo "Show the list of blocked users"
}
#function cmd_help ()
#{
# echo ""
#}
function cmd_help ()
{
echo "TODO: description"
}
function cmd_main ()
{

View File

@ -33,10 +33,10 @@ function cmd_info ()
echo "Sync blocklist for all servers"
}
#function cmd_help ()
#{
# echo ""
#}
function cmd_help ()
{
echo "TODO: description"
}
function cmd_main ()
{

View File

@ -35,10 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "By default, all files created by the kf2 server"
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"
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "Run the server binary directly, without systemd or anything else."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,8 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "Stops all running server instances, installs updates (if any)"
echo "When finished, starts all enabled instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,8 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "Stops all running server instances, validate server files."
echo "When finished, starts all enabled instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "Name(s) must not contain spaces."
echo "TODO: description"
}
function cmd_main ()

View File

@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info ()
{
echo "Send message to specified server instance(s)"
echo "Send message to specified server instances"
}
function cmd_help ()
{
echo "If instance is not specified, sends a message to all running servers."
echo "TODO: description"
}
function cmd_main ()

View File

@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info ()
{
echo "Delete the specified server instance(s)"
echo "Delete the specified server instances"
}
function cmd_help ()
{
echo "If instance is not specified, deletes all server instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info ()
{
echo "Disable autostart for specified server instance(s)"
echo "Disable specified server instance(s)"
}
function cmd_help ()
{
echo "If instance is not specified, disable autostart for all instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -30,12 +30,12 @@ function cmd_usage ()
function cmd_info ()
{
echo "Enable autostart for specified server instance(s)"
echo "Enable specified server instance(s)"
}
function cmd_help ()
{
echo "If instance is not specified, disable autostart for all instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, displays the status of all instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, restarts all enabled instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, starts all enabled instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, stops all instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, prints the log of all instances."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, prints the log of all instances in real time."
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, load map rotation for all instances."
echo "TODO: description"
}
function cmd_main () # $*: Instance[s]

View File

@ -35,7 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, save map rotation for all instances."
echo "TODO: description"
}
function cmd_main () # $*: Instance[s]

View File

@ -35,9 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, set a admin password for all instances."
echo "To remove a password, use an empty password as an argument,"
echo "example: ${ScriptFullname}${KF2POSTFIX} password admin '' test_instance"
echo "TODO: description"
}
function cmd_main ()

View File

@ -35,9 +35,7 @@ function cmd_info ()
function cmd_help ()
{
echo "If instance is not specified, set a game password for all instances."
echo "To remove a password, use an empty password as an argument,"
echo "example: ${ScriptFullname}${KF2POSTFIX} password game '' test_instance"
echo "TODO: description"
}
function cmd_main ()

View File

@ -25,7 +25,7 @@ cmd_need_installed_server () { false ;}
function cmd_usage ()
{
echo "<workshop_id>..."
echo "[<workshop_id>...]"
}
function cmd_info ()
@ -35,7 +35,7 @@ function cmd_info ()
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 ()

View File

@ -35,7 +35,7 @@ function cmd_info ()
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 ()

View File

@ -33,10 +33,10 @@ function cmd_info ()
echo "Show the list of steam workshop resources"
}
#function cmd_help ()
#{
# echo ""
#}
function cmd_help ()
{
echo "TODO: description"
}
function cmd_main ()
{

View File

@ -30,13 +30,12 @@ function cmd_usage ()
function cmd_info ()
{
echo "Sync steam workshop resources between all server instances"
echo "Sync steamorkshop resources between all server instances"
}
function cmd_help ()
{
echo "In addition to synchronization, adds loaded maps and mutators to KFGame.ini."
echo "This command works for stopped server instances only."
echo "TODO: description"
}
function cmd_main ()

View File

@ -197,22 +197,10 @@ elif [[ -d "$GroupPathname" ]]; then
shift
source "$CommandPathName"
if is_help "$1"; then
if ! function_exists "cmd_usage" \
&& ! function_exists "cmd_info" \
&& ! function_exists "cmd_help"; then
echo "No help page for this command."
else
if function_exists "cmd_usage"; then
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
else
echo "No help page for this command."
fi
elif is_usage "$1"; then
if function_exists "cmd_usage"; then

View File

@ -1,5 +1,6 @@
[Unit]
Description=Killing Floor 2 Beta Server Daemon - %i
After=kf2-srv-force-attr.service
After=network-online.target
Wants=network-online.target

View File

@ -1,5 +1,6 @@
[Unit]
Description=Killing Floor 2 Server Daemon - %i
After=kf2-srv-force-attr.service
After=network-online.target
Wants=network-online.target

View File

@ -1,7 +1,7 @@
%global steamuser steam
Name: kf2-srv
Version: 0.15.9
Version: 0.15.8
Release: 1%{dist}
Summary: Killing Floor 2 server
Group: Amusements/Games
@ -30,6 +30,7 @@ Requires: gawk
Requires: multini >= 0.2.3
Requires: rsyslog >= 8.25.0
Requires: logrotate
Requires: inotify-tools
Requires: bash-completion >= 2.7
Provides: %{name}
@ -73,6 +74,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,root,root) %config(noreplace) %{_prefix}/lib/firewalld/services/%{name}.xml
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{name}-beta
%attr(0755,root,root) %{_sbindir}/%{name}-force-attr
%attr(0644,root,root) %{_unitdir}/*
%attr(0644,root,root) %doc %{_datadir}/licenses/%{name}/*
%attr(0644,root,root) %{_sysconfdir}/rsyslog.d/%{name}.conf
@ -99,10 +101,8 @@ if [[ $1 == 1 ]]; then # Install
fi
%changelog
* Mon Sep 21 2020 GenZmeY <genzmey@gmail.com> - 0.16.0-1
- remove force-attr daemon;
- log cmg group;
- command descriptions.
* Tue Sep 8 2020 GenZmeY <genzmey@gmail.com> - 0.16.0-1
- log cmg group.
* Sat Aug 15 2020 GenZmeY <genzmey@gmail.com> - 0.15.4-1
- fixed broken update;