Get the code

Go to your directory where you place scripts and clone it

With read access - via https:

cd ~/scripts
git clone https://git-repo.iml.unibe.ch/iml-open-source/multi_ssh.git

File structure

You get these files in the multi_ssh directory:

.
├── README.md
├── color.class.sh          needed file with functions for coloring
├── config
│   ├── commands.txt.dist
│   │
│   ├── default
│   │   ├── commands.txt.dist
│   │   └── serverlist.json.dist
│   :
|   └── <profile-dir-N>
│       ├── commands.txt.dist
│       └── serverlist.json.dist
│
├── docs
│   ...
├── logs
└── multi_ssh.sh            << main script

Dome configuration files come with a .dist file. See next chapter for configuration.

First start

When you start the main script the first time a userconfig will be created. The script stops because a list of servers is missed.

> ./multi_ssh.sh 
_______________________________________________________________________________

 MULTI REMOTE EXECUTION WITH SSH                                         ______
________________________________________________________________________/ v0.18

INIT: Creating user config...
saved:
-rw-r--r-- 1 axel axel 684 May 24 11:58 config/userconfig.sh

INIT: Creating default commands ./config/commands.txt ...

WELCOME!
We need a file <serverlist.json> to start.

Create a file config/default/serverlist.json ... OR
You can create a new profile directory ./config/<PROFILE>/ and for a
seperate network with custom servers and commands.
HINT: Copy the template config/default/serverlist.json.dist to start.

If you want to switch to another profile use multi_ssh.sh -p