diff options
| author | Jeff Carr <[email protected]> | 2024-10-15 11:02:54 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-15 11:02:54 -0500 |
| commit | 86df520638e22e1ee42b1fe30672fa2473b5a6ad (patch) | |
| tree | 5563e4a7dff51c4b84d8fb5e26c1d9caa5be8918 /http.go | |
| parent | 5b47c44fb57a2b99661dba0f6a620c690703b58f (diff) | |
start works from the command line
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -6,6 +6,7 @@ import ( "os" "strings" + "go.wit.com/lib/gui/shell" "go.wit.com/log" ) @@ -17,6 +18,10 @@ func cleanURL(url string) string { func okHandler(w http.ResponseWriter, r *http.Request) { var tmp string + + log.Info("Got URL Path: ", r.URL.Path) + log.Info("Got URL Query:", r.URL.Query().Get("start")) + tmp = cleanURL(r.URL.Path) log.Info("Got URL:", tmp) @@ -48,7 +53,13 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if tmp == "/start" { start := r.URL.Query().Get("start") - fmt.Fprint(w,"Handling URL:", tmp, "should start here: droplet", start) + xml := "/root/jcarr/machines/autostart/" + start + ".xml" + cmd := []string{"virsh", "create", xml} + fmt.Fprintln(w, "Handling URL:", tmp, "should start here: droplet") + fmt.Fprintln(w, "start returned: ", start) + log.Warn("should start droplet", start, "here") + log.Warn("cmd :", cmd) + shell.Run(cmd) return } |
