Created
February 11, 2019 23:16
-
-
Save brianredbeard/2e3abe7430db6dce76ef9ce2509c47a4 to your computer and use it in GitHub Desktop.
Github Pubkeys - grab all keys from a list of users to generate an authorized_keys file
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
#!/bin/bash | |
set -e -u -o pipefail | |
# Provide a default list of users. This can be overriden by supplying the | |
# environment variable "USERS" | |
USERS=${USERS:-'brianredbeard chancez crawford ivancherepov kbrwn'} | |
for name in ${USERS}; do | |
curl -Ls http://github.com/${name}.keys | \ | |
sed -e "s/\$/ github-user:${name}/g" -e "s/^/ - /" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment