diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rwxr-xr-x | rubyfy.rb | 16 |
2 files changed, 10 insertions, 8 deletions
@@ -7,7 +7,7 @@ Example usage: ``` cat serverlist.txt | ./rubyfy -p 10 -c 'hostname' -./rubyfy -p 1 -c 'hostname' <<< foo.example.com +./rubyfy --root --command 'id' <<< foo.example.com ``` @@ -18,6 +18,8 @@ class Rubyfy @args[opt] = arg end + @args["--parallel"] = 1 unless @args["--parallel"] + log(:DEBUG, @args) if @args["--debug"] end @@ -65,13 +67,6 @@ class Rubyfy private - def log(severity, message) - return if severity == :VERBOSE and not @args["--verbose"] - @log_mutex.synchronize do - puts "#{severity}::#{message}" - end - end - def run_command(server, command="uptime", root=false, user=ENV["USER"]) log(:VERBOSE,"#{server}::Connecting") sudo = root ? "sudo " : "" @@ -103,6 +98,13 @@ private http = Net::HTTP.new(uri.host, uri.port) http.request(req).body end + + def log(severity, message) + return if severity == :VERBOSE and not @args["--verbose"] + @log_mutex.synchronize do + puts "#{severity}::#{message}" + end + end end begin |
