From 340f42bc33842848471025dca3ae1268cdd66a95 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Fri, 1 Nov 2024 12:32:34 +0100
Subject: [PATCH] update usage

---
 docs/40_Usage.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/docs/40_Usage.md b/docs/40_Usage.md
index 82c9498..cf66c76 100644
--- a/docs/40_Usage.md
+++ b/docs/40_Usage.md
@@ -2,6 +2,80 @@
 
 Just start `multi_ssh.sh` - it will initialize a user config file with the defaults.
 Without a parameter you reach the interactive mode.
+It supports cli parameters too.
+
+## Interactive usage
+
+### Server menu
+
+If you start the script, then you get a list of your servers.
+The list of servers is can be filtered with one or more tags.
+You can switch to another profile to see another set of servers.
+
+Server list:
+
+* Number - starting with `1`
+* Server - servername
+* Bastion (20 chars) - jumphost to connect; it is empty if the server is connected directly
+* last success - timestamp of the last execution of the set command with exitcode 0. If the field is empty the command was not executed yet. This field helps you to see if a command was executed on all servers alreadyor not.
+* Running - Info for curently running job or fisnished job and the terminal window is still open. If it is empty then the job is not running
+
+
+Behind the prompt you can type an action and press Return.
+
+Possible actions:
+
+* `:c` change command to execute on all servers
+* `:t` change tags
+* `:p` change profile
+* A single number - or multiple numbers separated by space: The current commad will be started on the given host in an extra terminal window
+
+### Change command
+
+After `:c` you get a list of config/commands.txt + all commands.txt in the profile directory for the current profile `config/<profile>/commands.txt`. This list helps you to pick a predefined action like maintenenace, backup, reboot, whatever.
+
+You see the current command.
+In the prompt enter the new command.
+
+Just return keeps the current command.
+
+Hint:
+
+Mark it with the mouse and paste it with middle mouse key.
+
+### Change tag
+
+After `:t` you get a list of all tags that are defined in your server configuration.
+
+Enter tags to filter hosts; seprate mulitple tags with space (from given list)
+
+Just return keeps the current tags(s).
+
+Hint:
+
+Mark it with the mouse and paste it with middle mouse key.
+
+### Change profile
+
+After `:p` you get a list of all configured profiles.
+
+Enter a prfile to switch too.
+
+Just return keeps the current tags(s).
+
+Hint:
+
+Mark it with the mouse and paste it with middle mouse key.
+
+### Execute the current command
+
+In the menu enter a single number - or multiple numbers separated by space.
+
+The current commad will be started on the given host in an extra terminal window.
+
+see ../config/userconfig.sh - `export MRE_TERMINAL=gnome-terminal`
+
+## CLI usage
 
 To see the parameters start `multi_ssh.sh -h`
 
-- 
GitLab