From 32a7d722a29dfc8b338bc7a419bd3188ad33383e Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Mon, 21 Sep 2020 05:41:30 +0300 Subject: [PATCH] command descriptions --- Makefile | 1 - SOURCES/main/cmdgrp/ban/add | 3 ++- SOURCES/main/cmdgrp/ban/delete | 3 ++- SOURCES/main/cmdgrp/ban/list | 8 ++++---- SOURCES/main/cmdgrp/ban/sync | 8 ++++---- SOURCES/main/cmdgrp/game/fix-permissions | 5 ++++- SOURCES/main/cmdgrp/game/run | 2 +- SOURCES/main/cmdgrp/game/update | 3 ++- SOURCES/main/cmdgrp/game/validate | 3 ++- SOURCES/main/cmdgrp/instance/add | 2 +- SOURCES/main/cmdgrp/instance/chat | 4 ++-- SOURCES/main/cmdgrp/instance/delete | 4 ++-- SOURCES/main/cmdgrp/instance/disable | 4 ++-- SOURCES/main/cmdgrp/instance/enable | 4 ++-- SOURCES/main/cmdgrp/instance/list | 2 +- SOURCES/main/cmdgrp/instance/restart | 2 +- SOURCES/main/cmdgrp/instance/start | 2 +- SOURCES/main/cmdgrp/instance/stop | 2 +- SOURCES/main/cmdgrp/log/cat | 2 +- SOURCES/main/cmdgrp/log/tail | 2 +- SOURCES/main/cmdgrp/maprotate/load | 2 +- SOURCES/main/cmdgrp/maprotate/save | 2 +- SOURCES/main/cmdgrp/password/admin | 4 +++- SOURCES/main/cmdgrp/password/game | 4 +++- SOURCES/main/cmdgrp/workshop/add | 4 ++-- SOURCES/main/cmdgrp/workshop/delete | 2 +- SOURCES/main/cmdgrp/workshop/list | 8 ++++---- SOURCES/main/cmdgrp/workshop/sync | 5 +++-- SOURCES/main/kf2-srv | 18 +++++++++++++++--- SPECS/kf2-srv.spec | 9 +++++---- 30 files changed, 74 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index 86056d9..d9b9549 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,6 @@ builddep: prep: clean-tmp cd $(SOURCESDIR) && tar czf $(SOURCETARBALL) \ config \ - force-attr \ main \ COPYING \ Makefile diff --git a/SOURCES/main/cmdgrp/ban/add b/SOURCES/main/cmdgrp/ban/add index f4e376c..f40b402 100644 --- a/SOURCES/main/cmdgrp/ban/add +++ b/SOURCES/main/cmdgrp/ban/add @@ -35,7 +35,8 @@ function cmd_info () 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 diff --git a/SOURCES/main/cmdgrp/ban/delete b/SOURCES/main/cmdgrp/ban/delete index b064220..633b514 100644 --- a/SOURCES/main/cmdgrp/ban/delete +++ b/SOURCES/main/cmdgrp/ban/delete @@ -35,7 +35,8 @@ function cmd_info () 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 diff --git a/SOURCES/main/cmdgrp/ban/list b/SOURCES/main/cmdgrp/ban/list index d0b0d9a..b3125a7 100644 --- a/SOURCES/main/cmdgrp/ban/list +++ b/SOURCES/main/cmdgrp/ban/list @@ -33,10 +33,10 @@ function cmd_info () echo "Show the list of blocked users" } -function cmd_help () -{ - echo "TODO: description" -} +#function cmd_help () +#{ +# echo "" +#} function cmd_main () { diff --git a/SOURCES/main/cmdgrp/ban/sync b/SOURCES/main/cmdgrp/ban/sync index be66212..936a156 100644 --- a/SOURCES/main/cmdgrp/ban/sync +++ b/SOURCES/main/cmdgrp/ban/sync @@ -33,10 +33,10 @@ function cmd_info () echo "Sync blocklist for all servers" } -function cmd_help () -{ - echo "TODO: description" -} +#function cmd_help () +#{ +# echo "" +#} function cmd_main () { diff --git a/SOURCES/main/cmdgrp/game/fix-permissions b/SOURCES/main/cmdgrp/game/fix-permissions index d533942..6086fa0 100644 --- a/SOURCES/main/cmdgrp/game/fix-permissions +++ b/SOURCES/main/cmdgrp/game/fix-permissions @@ -35,7 +35,10 @@ function cmd_info () 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 () diff --git a/SOURCES/main/cmdgrp/game/run b/SOURCES/main/cmdgrp/game/run index 1822386..7313233 100644 --- a/SOURCES/main/cmdgrp/game/run +++ b/SOURCES/main/cmdgrp/game/run @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "Run the server binary directly, without systemd or anything else." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/game/update b/SOURCES/main/cmdgrp/game/update index e6afb0a..8753002 100644 --- a/SOURCES/main/cmdgrp/game/update +++ b/SOURCES/main/cmdgrp/game/update @@ -35,7 +35,8 @@ function cmd_info () 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 () diff --git a/SOURCES/main/cmdgrp/game/validate b/SOURCES/main/cmdgrp/game/validate index b23f147..dc580a1 100644 --- a/SOURCES/main/cmdgrp/game/validate +++ b/SOURCES/main/cmdgrp/game/validate @@ -35,7 +35,8 @@ function cmd_info () 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 () diff --git a/SOURCES/main/cmdgrp/instance/add b/SOURCES/main/cmdgrp/instance/add index 1b6a2f4..fdb6dad 100644 --- a/SOURCES/main/cmdgrp/instance/add +++ b/SOURCES/main/cmdgrp/instance/add @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "Name(s) must not contain spaces." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/chat b/SOURCES/main/cmdgrp/instance/chat index 5178e33..cc3eb14 100644 --- a/SOURCES/main/cmdgrp/instance/chat +++ b/SOURCES/main/cmdgrp/instance/chat @@ -30,12 +30,12 @@ function cmd_usage () function cmd_info () { - echo "Send message to specified server instances" + echo "Send message to specified server instance(s)" } function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, sends a message to all running servers." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/delete b/SOURCES/main/cmdgrp/instance/delete index feba430..4a7693e 100644 --- a/SOURCES/main/cmdgrp/instance/delete +++ b/SOURCES/main/cmdgrp/instance/delete @@ -30,12 +30,12 @@ function cmd_usage () function cmd_info () { - echo "Delete the specified server instances" + echo "Delete the specified server instance(s)" } function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, deletes all server instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/disable b/SOURCES/main/cmdgrp/instance/disable index 6c91814..c172b67 100644 --- a/SOURCES/main/cmdgrp/instance/disable +++ b/SOURCES/main/cmdgrp/instance/disable @@ -30,12 +30,12 @@ function cmd_usage () function cmd_info () { - echo "Disable specified server instance(s)" + echo "Disable autostart for specified server instance(s)" } function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, disable autostart for all instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/enable b/SOURCES/main/cmdgrp/instance/enable index bd0d96e..2443694 100644 --- a/SOURCES/main/cmdgrp/instance/enable +++ b/SOURCES/main/cmdgrp/instance/enable @@ -30,12 +30,12 @@ function cmd_usage () function cmd_info () { - echo "Enable specified server instance(s)" + echo "Enable autostart for specified server instance(s)" } function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, disable autostart for all instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/list b/SOURCES/main/cmdgrp/instance/list index 676ede4..8b39206 100644 --- a/SOURCES/main/cmdgrp/instance/list +++ b/SOURCES/main/cmdgrp/instance/list @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, displays the status of all instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/restart b/SOURCES/main/cmdgrp/instance/restart index fcc39f8..585c794 100644 --- a/SOURCES/main/cmdgrp/instance/restart +++ b/SOURCES/main/cmdgrp/instance/restart @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, restarts all enabled instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/start b/SOURCES/main/cmdgrp/instance/start index 6a0ddba..8ef16b4 100644 --- a/SOURCES/main/cmdgrp/instance/start +++ b/SOURCES/main/cmdgrp/instance/start @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, starts all enabled instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/instance/stop b/SOURCES/main/cmdgrp/instance/stop index 0d04ebf..b5d0068 100644 --- a/SOURCES/main/cmdgrp/instance/stop +++ b/SOURCES/main/cmdgrp/instance/stop @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, stops all instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/log/cat b/SOURCES/main/cmdgrp/log/cat index f6cbc6e..8cda79d 100644 --- a/SOURCES/main/cmdgrp/log/cat +++ b/SOURCES/main/cmdgrp/log/cat @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, prints the log of all instances." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/log/tail b/SOURCES/main/cmdgrp/log/tail index c6c9194..76e0ace 100644 --- a/SOURCES/main/cmdgrp/log/tail +++ b/SOURCES/main/cmdgrp/log/tail @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, prints the log of all instances in real time." } function cmd_main () diff --git a/SOURCES/main/cmdgrp/maprotate/load b/SOURCES/main/cmdgrp/maprotate/load index de02e07..a44b41b 100644 --- a/SOURCES/main/cmdgrp/maprotate/load +++ b/SOURCES/main/cmdgrp/maprotate/load @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, load map rotation for all instances." } function cmd_main () # $*: Instance[s] diff --git a/SOURCES/main/cmdgrp/maprotate/save b/SOURCES/main/cmdgrp/maprotate/save index 7902a60..7743ac3 100644 --- a/SOURCES/main/cmdgrp/maprotate/save +++ b/SOURCES/main/cmdgrp/maprotate/save @@ -35,7 +35,7 @@ function cmd_info () function cmd_help () { - echo "TODO: description" + echo "If instance is not specified, save map rotation for all instances." } function cmd_main () # $*: Instance[s] diff --git a/SOURCES/main/cmdgrp/password/admin b/SOURCES/main/cmdgrp/password/admin index e1e59dd..5aeb848 100644 --- a/SOURCES/main/cmdgrp/password/admin +++ b/SOURCES/main/cmdgrp/password/admin @@ -35,7 +35,9 @@ function cmd_info () 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 () diff --git a/SOURCES/main/cmdgrp/password/game b/SOURCES/main/cmdgrp/password/game index 36658ad..3fafcac 100644 --- a/SOURCES/main/cmdgrp/password/game +++ b/SOURCES/main/cmdgrp/password/game @@ -35,7 +35,9 @@ function cmd_info () 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 () diff --git a/SOURCES/main/cmdgrp/workshop/add b/SOURCES/main/cmdgrp/workshop/add index 08db0df..fd79c58 100644 --- a/SOURCES/main/cmdgrp/workshop/add +++ b/SOURCES/main/cmdgrp/workshop/add @@ -25,7 +25,7 @@ cmd_need_installed_server () { false ;} function cmd_usage () { - echo "[...]" + echo "..." } function cmd_info () @@ -35,7 +35,7 @@ function cmd_info () 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 () diff --git a/SOURCES/main/cmdgrp/workshop/delete b/SOURCES/main/cmdgrp/workshop/delete index 774568e..fbd0b82 100644 --- a/SOURCES/main/cmdgrp/workshop/delete +++ b/SOURCES/main/cmdgrp/workshop/delete @@ -35,7 +35,7 @@ function cmd_info () 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 () diff --git a/SOURCES/main/cmdgrp/workshop/list b/SOURCES/main/cmdgrp/workshop/list index 4e82ca3..6e891db 100644 --- a/SOURCES/main/cmdgrp/workshop/list +++ b/SOURCES/main/cmdgrp/workshop/list @@ -33,10 +33,10 @@ function cmd_info () echo "Show the list of steam workshop resources" } -function cmd_help () -{ - echo "TODO: description" -} +#function cmd_help () +#{ +# echo "" +#} function cmd_main () { diff --git a/SOURCES/main/cmdgrp/workshop/sync b/SOURCES/main/cmdgrp/workshop/sync index 072cdcc..a3ce4cd 100644 --- a/SOURCES/main/cmdgrp/workshop/sync +++ b/SOURCES/main/cmdgrp/workshop/sync @@ -30,12 +30,13 @@ function cmd_usage () function cmd_info () { - echo "Sync steamorkshop resources between all server instances" + echo "Sync steam workshop resources between all server instances" } 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 () diff --git a/SOURCES/main/kf2-srv b/SOURCES/main/kf2-srv index 0ed06e9..0684776 100755 --- a/SOURCES/main/kf2-srv +++ b/SOURCES/main/kf2-srv @@ -197,10 +197,22 @@ elif [[ -d "$GroupPathname" ]]; then shift source "$CommandPathName" if is_help "$1"; then - if function_exists "cmd_help"; then - cmd_help - else + 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 fi elif is_usage "$1"; then if function_exists "cmd_usage"; then diff --git a/SPECS/kf2-srv.spec b/SPECS/kf2-srv.spec index 70eae34..d7d5c69 100644 --- a/SPECS/kf2-srv.spec +++ b/SPECS/kf2-srv.spec @@ -1,7 +1,7 @@ %global steamuser steam Name: kf2-srv -Version: 0.15.8 +Version: 0.15.9 Release: 1%{dist} Summary: Killing Floor 2 server Group: Amusements/Games @@ -74,7 +74,6 @@ 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 @@ -101,8 +100,10 @@ if [[ $1 == 1 ]]; then # Install fi %changelog -* Tue Sep 8 2020 GenZmeY - 0.16.0-1 -- log cmg group. +* Mon Sep 21 2020 GenZmeY - 0.16.0-1 +- remove force-attr daemon; +- log cmg group; +- command descriptions. * Sat Aug 15 2020 GenZmeY - 0.15.4-1 - fixed broken update;