Skip to content

Instantly share code, notes, and snippets.

@cmouse
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmouse/4dc3c24d5cdcaad0f681 to your computer and use it in GitHub Desktop.
Save cmouse/4dc3c24d5cdcaad0f681 to your computer and use it in GitHub Desktop.
NLNOG Ring key management
#!/bin/sh
set -o errexit
git archive --format=tar HEAD | tar -Ox --wildcards '*.key' > $HOME/ssh-keys.new
if [ -s $HOME/ssh-keys.new ]; then
cat > $HOME/ssh-keys.tmp <<EOF
## THIS FILE IS AUTOGENERATED FROM GIT
## Do not edit by hand - instead add your key
## to <your company place>
## and read README.md for deployment instructions
##
EOF
cat $HOME/ssh-keys.new >> $HOME/ssh-keys.tmp
mv -f $HOME/ssh-keys.tmp $HOME/ssh-keys
fi
rm -f $HOME/ssh-keys.new
exec git update-server-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment