Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
6ff2e51458 | |||
32a7d722a2 |
1
Makefile
1
Makefile
@ -46,7 +46,6 @@ 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
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
#!/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'
|
|
@ -35,7 +35,8 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "Id can be SteamID3, SteamID64 or a link to a user profile."
|
||||||
|
echo "EGS players are not supported."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main () # $*: ban list
|
function cmd_main () # $*: ban list
|
||||||
|
@ -35,7 +35,8 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "Id can be SteamID3, SteamID64 or a link to a user profile."
|
||||||
|
echo "EGS players are not supported."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main () # $*: ban list
|
function cmd_main () # $*: ban list
|
||||||
|
@ -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 "TODO: description"
|
# echo ""
|
||||||
}
|
#}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
{
|
{
|
||||||
|
@ -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 "TODO: description"
|
# echo ""
|
||||||
}
|
#}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,10 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "Run the server binary directly, without systemd or anything else."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,8 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "Stops all running server instances, installs updates (if any)"
|
||||||
|
echo "When finished, starts all enabled instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,8 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "Stops all running server instances, validate server files."
|
||||||
|
echo "When finished, starts all enabled instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "Name(s) must not contain spaces."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -30,12 +30,12 @@ function cmd_usage ()
|
|||||||
|
|
||||||
function cmd_info ()
|
function cmd_info ()
|
||||||
{
|
{
|
||||||
echo "Send message to specified server instances"
|
echo "Send message to specified server instance(s)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, sends a message to all running servers."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -30,12 +30,12 @@ function cmd_usage ()
|
|||||||
|
|
||||||
function cmd_info ()
|
function cmd_info ()
|
||||||
{
|
{
|
||||||
echo "Delete the specified server instances"
|
echo "Delete the specified server instance(s)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, deletes all server instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -30,12 +30,12 @@ function cmd_usage ()
|
|||||||
|
|
||||||
function cmd_info ()
|
function cmd_info ()
|
||||||
{
|
{
|
||||||
echo "Disable specified server instance(s)"
|
echo "Disable autostart for specified server instance(s)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, disable autostart for all instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -30,12 +30,12 @@ function cmd_usage ()
|
|||||||
|
|
||||||
function cmd_info ()
|
function cmd_info ()
|
||||||
{
|
{
|
||||||
echo "Enable specified server instance(s)"
|
echo "Enable autostart for specified server instance(s)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, disable autostart for all instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, displays the status of all instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, restarts all enabled instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, starts all enabled instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, stops all instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, prints the log of all instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, prints the log of all instances in real time."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, load map rotation for all instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main () # $*: Instance[s]
|
function cmd_main () # $*: Instance[s]
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "If instance is not specified, save map rotation for all instances."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main () # $*: Instance[s]
|
function cmd_main () # $*: Instance[s]
|
||||||
|
@ -35,7 +35,9 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,9 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -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 "TODO: description"
|
echo "workshop_id can be a resource ID or a link to a resource in workshop."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -35,7 +35,7 @@ function cmd_info ()
|
|||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "workshop_id can be a resource ID or a link to a resource in workshop."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -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 "TODO: description"
|
# echo ""
|
||||||
}
|
#}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
{
|
{
|
||||||
|
@ -30,12 +30,13 @@ function cmd_usage ()
|
|||||||
|
|
||||||
function cmd_info ()
|
function cmd_info ()
|
||||||
{
|
{
|
||||||
echo "Sync steamorkshop resources between all server instances"
|
echo "Sync steam workshop resources between all server instances"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_help ()
|
function cmd_help ()
|
||||||
{
|
{
|
||||||
echo "TODO: description"
|
echo "In addition to synchronization, adds loaded maps and mutators to KFGame.ini."
|
||||||
|
echo "This command works for stopped server instances only."
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_main ()
|
function cmd_main ()
|
||||||
|
@ -197,10 +197,22 @@ 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" \
|
||||||
|
&& ! 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
|
if function_exists "cmd_help"; then
|
||||||
cmd_help
|
cmd_help
|
||||||
else
|
fi
|
||||||
echo "No help page for this command."
|
|
||||||
fi
|
fi
|
||||||
elif is_usage "$1"; then
|
elif is_usage "$1"; then
|
||||||
if function_exists "cmd_usage"; then
|
if function_exists "cmd_usage"; then
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Killing Floor 2 Beta Server Daemon - %i
|
Description=Killing Floor 2 Beta Server Daemon - %i
|
||||||
After=kf2-srv-force-attr.service
|
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Killing Floor 2 Server Daemon - %i
|
Description=Killing Floor 2 Server Daemon - %i
|
||||||
After=kf2-srv-force-attr.service
|
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%global steamuser steam
|
%global steamuser steam
|
||||||
|
|
||||||
Name: kf2-srv
|
Name: kf2-srv
|
||||||
Version: 0.15.8
|
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}
|
||||||
@ -74,7 +73,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%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,8 +99,10 @@ if [[ $1 == 1 ]]; then # Install
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Sep 8 2020 GenZmeY <genzmey@gmail.com> - 0.16.0-1
|
* Mon Sep 21 2020 GenZmeY <genzmey@gmail.com> - 0.16.0-1
|
||||||
- log cmg group.
|
- 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;
|
||||||
|
Reference in New Issue
Block a user