Skip to content

Instantly share code, notes, and snippets.

@dan1elhughes
Last active August 3, 2020 10:16
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 dan1elhughes/2cd9e55b07022a180ba8ad7c86746336 to your computer and use it in GitHub Desktop.
Save dan1elhughes/2cd9e55b07022a180ba8ad7c86746336 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Use github as a authorized_keys file. Single-user system only, probably janky and a bad idea in many ways.
url="https://danhughes.dev/keys"
cachefile="/tmp/keycache"
keys=$(curl -sfL $url)
code=$?
if [ "$code" -eq "0" ]; then
echo "$keys" | tee $cachefile
else
cat $cachefile
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment