summaryrefslogtreecommitdiff
path: root/bin/ssh-list-authorized-keys
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-07-07 18:31:06 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-07-07 18:31:06 -0400
commitf985decc7edecd2376a4d08cdc29bbf42f18da12 (patch)
treef7e8f1e2a49b8152fe33b648daa85fba04fb8181 /bin/ssh-list-authorized-keys
parent70f3940aa125991d1a565b263b145ee8a63a23ad (diff)
mv {misc/,}git-shell-commands ; remove everything else
Diffstat (limited to 'bin/ssh-list-authorized-keys')
-rwxr-xr-xbin/ssh-list-authorized-keys30
1 files changed, 0 insertions, 30 deletions
diff --git a/bin/ssh-list-authorized-keys b/bin/ssh-list-authorized-keys
deleted file mode 100755
index 6a03c8d..0000000
--- a/bin/ssh-list-authorized-keys
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env ruby
-# Usage: ssh-list-authorized-keys [username]
-cfg_groups = [ "repo", "git" ]
-
-######################################################################
-require 'set'
-require 'yaml'
-
-all_users = Dir.glob("users/*.yml").map{|f|YAML::load(open(f))}
-users = Set.new
-
-groupnames = ARGV & cfg_groups
-usernames = ARGV & all_users.map{|u|u["username"]}
-
-unless groupnames.empty?
- groupnames.push("hackers")
-end
-
-users = all_users.find_all{|u| usernames.include?(u["username"]) or not ((u["groups"]||[]) & groupnames).empty?}
-
-# Buffer the output to avoid EPIPE when the reader hangs up early
-output=""
-users.each do |user|
- if user["ssh_keys"]
- user["ssh_keys"].each do |addr,key|
- output+="#{key} #{user["fullname"]} (#{user["username"]}) <#{addr}>\n"
- end
- end
-end
-print output