diff options
| author | Paul Buetow (uranus) <paul@buetow.org> | 2015-10-18 10:03:36 +0100 |
|---|---|---|
| committer | Paul Buetow (uranus) <paul@buetow.org> | 2015-10-18 10:03:36 +0100 |
| commit | 72154dea24b89e087d85e31acec9f64afef756cc (patch) | |
| tree | c5885f296e874f68c83503e9c25b8f4d762e6103 /rubyfy.rb | |
| parent | 25813dd0e4a46af5bc4a41d628c6c349cf55fba5 (diff) | |
add user switch
Diffstat (limited to 'rubyfy.rb')
| -rwxr-xr-x | rubyfy.rb | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -18,7 +18,9 @@ class Rubyfy @args[opt] = arg end + # Set defaults @args["--parallel"] = 1 unless @args["--parallel"] + @args["--user"] = ENV["USER"] unless @args["--user"] log(:DEBUG, @args) if @args["--debug"] end @@ -33,6 +35,7 @@ class Rubyfy :SERVER => server, :COMMAND => @args["--command"], :ROOT => @args["--root"], + :USER => @args["--user"], :STATUS => :NONE, } jobs << job @@ -82,11 +85,12 @@ private server = job[:SERVER] command = job[:COMMAND] root = job[:ROOT] + user = job[:USER] log(:VERBOSE, "#{server}::Running job #{job}") if File.exists?("#{server}.ignore") log(:INFO, "#{server}::Ignoring this server") else - run_command server, command, root + run_command server, command, root, user end job[:STATUS] = :OK end @@ -112,11 +116,11 @@ begin [ "--command", "-c", GetoptLong::REQUIRED_ARGUMENT ], [ "--debug", "-d", GetoptLong::OPTIONAL_ARGUMENT ], [ "--parallel", "-p", GetoptLong::OPTIONAL_ARGUMENT ], + [ "--user", "-u", GetoptLong::OPTIONAL_ARGUMENT ], [ "--root", "-r", GetoptLong::OPTIONAL_ARGUMENT ], [ "--silent", "-s", GetoptLong::OPTIONAL_ARGUMENT ], [ "--verbose", "-v", GetoptLong::OPTIONAL_ARGUMENT ], ) - rubyfy = Rubyfy.new(opts) - rubyfy.run + Rubyfy.new(opts).run end |
