Skip to content

Instantly share code, notes, and snippets.

@jpmens
Created February 1, 2012 10:50
Show Gist options
  • Save jpmens/1716455 to your computer and use it in GitHub Desktop.
Save jpmens/1716455 to your computer and use it in GitHub Desktop.
Create SSHFP records from facter facts
#!/bin/sh
fqdn=`facter fqdn`
for algo in rsa dsa
do
type=$algo
[ $type == 'dsa' ] && type=dss
facter "ssh${algo}key" | sed -e "s/^/ssh-${type} /" > /tmp/x
ssh-keygen -r $fqdn -f /tmp/x
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment