Skip to content

zrcoder/rGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rGo

rGo means "Ready? Go!" or "remote go" ~
It can execute commands(or a shell script) on multiple remote hosts almost at the same time

Usage

common

Edit config.json to config the remote hosts. For example:

[
  {"host":"1.1.1.1"},
  {"host":"1.2.3.4"},
  {"host":"4.3.2.1"}
]

ready? let's go

./rGo -u root -p -c "cd /tmp; touch abc"

and a promtp appears:

Please enter the password:

after entered the password (which will not be showed),
rGo will login to each host and execute your commands.

Another example

config.json:

[
  {"host":"localhost"},
  {"host":"1.1.1.1"},
  {"host":"1.2.3.4", "user":"abc", "password":"xxx"},
  {"host":"2.2.2.2", "user":"ttt", "password":"vvv"},
  {"host":"4.3.2.1", "user":"kkk", "key_files":["~/.ssh/id_rsa"]}
]

If host is 'localhost' or '127.0.0.1', commands will be executed locally
'password' and 'key_files' are optional, just for authentication

./rGo -c "echo Hello; ls ~"

or you can execute a shell script with the "-sh" option, like:

./rGo -sh test.sh

Help info

You can type this line:

./rGo --help

to get a breif help info:

Usage of rGo:
  -c string
	commands (can be separated with ";")
  -sh string
	shell script to be executed

  -u string
	if there is no "user" field of some record in config.json,
	value of this option will be used
  -p
	if there is no "paasword" or "key_files" field of some records in config.json,
	we can use this option and then enter the paasword

About

Execute commands(or a shell script) on multiple remote hosts almost at the same time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages