|
|
@ -13,9 +13,13 @@ end
|
|
|
|
cd File.expand_path('~/.ssh')
|
|
|
|
cd File.expand_path('~/.ssh')
|
|
|
|
|
|
|
|
|
|
|
|
with_mount "~/Dropbox/sekritz.sparseimage" do |mountpoint|
|
|
|
|
with_mount "~/Dropbox/sekritz.sparseimage" do |mountpoint|
|
|
|
|
Dir["#{mountpoint}/ssh keys/*"].each do |file|
|
|
|
|
from = Dir["#{mountpoint}/ssh keys/*"]
|
|
|
|
cp file, File.basename(file)
|
|
|
|
to = from.map {|file| File.basename(file) }
|
|
|
|
puts `chmod go-r #{File.basename(file)}`
|
|
|
|
from.zip(to).each do |from, to|
|
|
|
|
puts `ssh-add -K #{File.basename(file)}`
|
|
|
|
next if File.exist?(to)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cp from, to
|
|
|
|
|
|
|
|
puts `chmod go-r #{to}`
|
|
|
|
|
|
|
|
puts `ssh-add -K #{to}`
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|