]> apps.delaporte.us Git - dotfiles.git/blobdiff - invoke/luanti-remote/tasks.py
Add serve command
[dotfiles.git] / invoke / luanti-remote / tasks.py
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d62171d68d29b19f484aaad170572c52d6e65f6b 100644 (file)
@@ -0,0 +1,21 @@
+from invoke import task
+import os
+
+IP=os.environ.get('LUANTI_IP')
+USER=os.environ.get('LUANTI_USER')
+HOME=os.environ.get('LUANTI_HOME')
+
+SERVE=f'{HOME}/luanti/bin/luantiserver --gameid minetest --worldname world'
+
+def browse(c, url):
+    c.run(f"librefox {url}")
+
+@task
+def serve(c):
+    print(f"Attempting to connect to {IP}")
+    c.run(f'ssh {USER}@{IP} -C {SERVE}')
+
+@task
+def cli_hint(c):
+    browse(c, 'https://console.kamatera.com/cli')
+