mirror of
https://github.com/theupriser/steamify-cachyos-dev.git
synced 2026-10-05 12:45:56 +02:00
feat: scripts/vminstall.sh installs an ssh-ready test VM unattended; TESTPLAN.md; vm-install skill
This commit is contained in:
1 parent
21547dd7bc
commit
60a2698d02
19 files changed
+705
-72
No files matched your search
@@ -0,0 +1,28 @@
|
||||
# vminstall-server.py <dir> <port>: serves <dir> to the installing VM (the
|
||||
# guest reaches the host as 10.0.2.2) and stores what it PUTs there (the
|
||||
# install log, the final status). Only on 127.0.0.1. Used by vminstall.sh.
|
||||
import http.server, os, sys
|
||||
|
||||
root, port = sys.argv[1], int(sys.argv[2])
|
||||
os.chdir(root)
|
||||
|
||||
|
||||
class Handler(http.server.SimpleHTTPRequestHandler):
|
||||
def do_PUT(self):
|
||||
name = os.path.basename(self.path)
|
||||
if not name:
|
||||
self.send_error(400)
|
||||
return
|
||||
data = self.rfile.read(int(self.headers.get("Content-Length", 0)))
|
||||
with open(name, "wb") as f:
|
||||
f.write(data)
|
||||
self.send_response(204)
|
||||
self.end_headers()
|
||||
|
||||
def log_message(self, fmt, *args):
|
||||
# requests.log: shows the live system reached the host, and when.
|
||||
with open("requests.log", "a") as f:
|
||||
f.write("%s %s\n" % (self.log_date_time_string(), fmt % args))
|
||||
|
||||
|
||||
http.server.ThreadingHTTPServer(("127.0.0.1", port), Handler).serve_forever()
|
||||
Reference in new issue
Block a user