Skip to content
Browse files

Adding a -w --wait option, to splay icagent

  • Loading branch information...
1 parent e1b9945 commit 5506e090821a3943f436b8fdf25e50ab98352131 @adamhjk committed Jan 23, 2008
Showing with 8 additions and 0 deletions.
  1. +8 −0 bin/icagent
View
8 bin/icagent
@@ -45,6 +45,9 @@ opts = OptionParser.new do |opts|
opts.on("-n", "--no-action", "Don't update anything, just print.") do |n|
config[:dryrun] = true
end
+ opts.on("-w WAIT", "--wait TIME", "Wait for up to TIME seconds.") do |w|
+ config[:wait] = w.to_i
+ end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
@@ -58,6 +61,11 @@ unless config.has_key?(:recipe) || config.has_key?(:directory)
exit
end
+if config.has_key?(:wait)
+ splay = rand(config[:wait])
+ sleep(splay)
+end
+
agent = IClassify::Agent.new(config[:uuidfile], config[:server])
begin
agent.load

0 comments on commit 5506e09

Please sign in to comment.
Something went wrong with that request. Please try again.