From 5d0a623b287ed82c3af1975a64ac4c19748c6ef4 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 15 Oct 2020 13:34:34 +0200 Subject: [PATCH] script to add ssh keys --- tools/scripts/setup_ssh_keys.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 tools/scripts/setup_ssh_keys.py diff --git a/tools/scripts/setup_ssh_keys.py b/tools/scripts/setup_ssh_keys.py new file mode 100755 index 0000000000..f6f665de7a --- /dev/null +++ b/tools/scripts/setup_ssh_keys.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import requests +from common.params import Params +import sys + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("%s " % sys.argv[0]) + exit(1) + + username = sys.argv[1] + keys = requests.get(f"https://github.com/{username}.keys") + + if keys.status_code == 200: + Params().put("GithubSshKeys", keys.text) + print("Setup ssh keys sucessfully") + else: + print("Error getting public keys from github")