Skip to content

Instantly share code, notes, and snippets.

@barn
Created August 17, 2012 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barn/3382576 to your computer and use it in GitHub Desktop.
Save barn/3382576 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#
OURCHANNEL = '#plops'
REMOTEY = 'someone@ningyo.dc1.puppetlabs.net'
def main( argv )
# Args are: whom channel channel command *args
# barn #plops #plops sign foo
whom, channel, ochannel, command, args = argv
if channel == OURCHANNEL and ochannel == OURCHANNEL
puts "We meet again #{args} #{args.type}"
dosign( args )
else
# puts "In #{channel} or #{ochannel}, #{whom} asked me to run #{command} with #{args}, which I won't."
dosign( args )
end
end
def dosign( certs )
# Fuck yeah rest.
# https://projects.puppetlabs.com/projects/1/wiki/Certificate_Authority_Rest_API
# puts "sign"
system( "sudo -u mco -foo sign #{certs}" )
end
main ARGV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment