Skip to content
Trooper is easy library for send remote commands
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src
test
.gitignore
.travis.yml
COPYING
Makefile
README.md
codecov.yml
rebar.config
rebar.lock
rebar3

README.md

Trooper

Copyright (c) 2016-2019 Altenwald Solutions, S.L.

Authors: "Manuel Rubio (manuel@altenwald.com).

Build Status Codecov License: LGPL 2.1 Hex

Trooper is a soldier in charge to go to other machines (via SSH) and follow your commands.

Requirements

Trooper requires to be run over an Erlang/OTP 19+.

Erlang Version Support Notes
21.2 ✔️ Recommended if you use OTP 21
21.1 ✔️
21.0 ✔️
20.3 ✔️ Recommended if you use OTP 20
20.2 ✔️
20.1 ✔️
20.0 ✔️
19.3 ✔️ Recommended if you use OTP 19
19.2 ✔️
19.1 ✔️
19.0 ✔️

Example

1> {ok, File} = file:read_file("/home/trooper/.ssh/id_rsa").
{ok,<<"-----BEGIN RSA PRIVATE KEY-----\nMIIE"...>>}
2> {ok,Trooper} = trooper_ssh:start([{host, "trooper.com"},
                                     {user, "trooper"},
                                     {id_rsa, File}]), ok.
ok
3> trooper_ssh:exec(Trooper, "ls -lha").
{ok,0,
    <<"total 128K\ndrwxr-xr-x 10 trooper trooper 4.0K Mar  8 16:54"...>>}
4> trooper_ssh:exec(Trooper, "ls not_found").
{ok,2,
    <<"ls: cannot access not_found: No such file or directory\n">>}
5> trooper_ssh:stop(Trooper).
ok

You can use for the options whatever from ssh:connect/3 options.

Enjoy!

Modules

trooper_app
trooper_keys
trooper_proxy
trooper_proxy_chain
trooper_proxy_sup
trooper_scp
trooper_ssh
You can’t perform that action at this time.