Skip to content

Instantly share code, notes, and snippets.

@paul
Created December 20, 2010 23:49
Show Gist options
  • Save paul/749243 to your computer and use it in GitHub Desktop.
Save paul/749243 to your computer and use it in GitHub Desktop.
Dir["files/default/keys/*"].each do |key_file|
execute "add key #{File.basename(key_file)}" do
command %{cat #{key_file} >> #{authorized_keys}}
not_if %{grep -qf #{key_file} #{authorized_keys}}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment