Created
April 11, 2014 15:48
-
-
Save gswallow/10479197 to your computer and use it in GitHub Desktop.
Create an SSL cert data bag from raw certificate files
This file contains 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 | |
require 'json' | |
id = ARGV.shift | |
cert = Array.new | |
ARGV.each do |file| | |
File.open(file, 'r').each_line do |line| | |
cert << line.strip | |
end | |
end | |
json = { :id => id, :cert => cert } | |
puts JSON.pretty_generate(json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment