Instantly share code, notes, and snippets.

@cmouse /post-update
Last active Aug 29, 2015

Embed
What would you like to do?
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