diff --git a/README.md b/README.md new file mode 100644 index 0000000..a26c46f --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# MultiSshDeployer + +This tool provides a straightforward way to execute multiple Bash commands on various devices. + +## How to use + +1. Launch a terminal and navigate to this directory. +2. Execute `npm install` to install all necessary dependencies. +3. Enter `npm start` to generate a new `config.json` file within the directory. +4. Modify the `config.json` file to configure your deployment settings. +5. Run `npm start` once more to initiate the deployment of Bash commands. +6. The outputs from each device will be saved in the output folder. + +## Configuration + +This tool features an easy-to-use configuration that can be modified through the `config.json` file. If the file is not present, run `npm start` to generate it. Below is an example of a typical configuration: + +```JSON +{ + "addresses": ["192.168.0.100", "192.168.0.101:80"], + "username": "username", + "password": "password", + "payload": [ + "ls -l", + "reboot", + "exit" + ] +} +``` + +| Property | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------ | +| addresses | string[] | This is a list of device addresses. If no port is specified, it will default to port `22`. | +| username | string | Represents the SSH username. | +| password | string | Indicates the SSH password. | +| payload | string[] | A list of Bash commands to be executed. | + +## Output + +While running the tool, all SSH output will be displayed in the console and saved to a log file within the `output` directory. Each log file will be named using the corresponding device address. Please note that if a log file with the same name already exists in the `output` directory, it will be **overwritten**! diff --git a/package.json b/package.json index 889cb4e..1cb8af8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "version": "1.0.0", "description": "", "main": "index.js", - "scripts": {}, + "scripts": { + "start": "node ." + }, "author": "", "license": "ISC", "dependencies": {