Last active
June 10, 2019 12:57
-
-
Save chaspy/e02a9be2a622f69022ed6c0d6f2512c7 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
#!/bin/bash | |
set -eux | |
set -o pipefail | |
if [ "$(id -un)" != "root" ]; then | |
echo "You should run with sudo." 1>&2 | |
echo "-------------------------" | |
exit 1 | |
fi | |
user=$1 | |
test -f /home/$user/.ssh/authorized_keys | |
curl -f https://github.com/${user}.keys | tee -a /home/$user/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment