Last active
August 3, 2020 10:16
-
-
Save dan1elhughes/2cd9e55b07022a180ba8ad7c86746336 to your computer and use it in GitHub Desktop.
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
#!/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