Open SSH example
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Mon, 25 Jun 2018 18:22:03 +0000 (14:22 -0400)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Mon, 25 Jun 2018 18:22:03 +0000 (14:22 -0400)
libremanage.py

index dc5172243e12975a00fee49feea359c84998fbc9..b089ca9a6b64b2ec3f6a49836730c4c5cea889ad 100644 (file)
@@ -20,6 +20,7 @@ along with this program.  If not, see <https://www.gnu.org/licenses/>.
 import sys
 import json
 import functools
+import subprocess
 
 USAGE = """
 Usage:
@@ -42,7 +43,7 @@ with open("config.json") as f:
     CONFIG = json.load(f)
 
 def open_ssh(config):
-    print(config)
+    subprocess.run(["ssh", config["username"] + "@" + config["host"], "-p", str(config["port"])])
 
 open_ssh(CONFIG["managers"]["myboard"])
 print(CONFIG)