Created
August 17, 2012 20:56
-
-
Save barn/3382576 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
OURCHANNEL = '#plops' | |
REMOTEY = '[email protected]' | |
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