1
0
Fork 0

Update new-host.sh

main
Mari 4 years ago committed by GitHub
parent 4946fcd81d
commit f4bdd75d61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      new-host.sh

@ -28,7 +28,8 @@ fi
function getCurrentGithubId() {
local RESULT;
RESULT=$(ssh -o "IdentitiesOnly=yes" -i ~/.ssh/id_ed25519 -T git@github.com </dev/null 2>&1) || echo "$RESULT" >&2; exit 1
RESULT=$(ssh -o "IdentitiesOnly=yes" -i ~/.ssh/id_ed25519 -T git@github.com </dev/null 2>&1)
[[ $? -ne 255 ]] || echo "$RESULT" >&2; exit 1
USERNAME=$(echo "$RESULT" | sed -n 's/^Hi \([^!]\+\)! You'"'"'ve successfully authenticated, but GitHub does not provide shell access\.$/Successfully authenticated to GitHub as \1/; T; p') || exit 1
echo "$USERNAME"
[[ -n "$USERNAME" ]];

Loading…
Cancel
Save