diff options
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 } |
