kopia lustrzana https://github.com/cyoung/stratux
RO Partition rebuild from WebUI.
rodzic
e356194eb2
commit
66c29aa9a6
|
@ -20,6 +20,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"syscall"
|
||||
"text/template"
|
||||
|
@ -312,6 +313,19 @@ func defaultServer(w http.ResponseWriter, r *http.Request) {
|
|||
http.FileServer(http.Dir("/var/www")).ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
func handleroPartitionRebuild() {
|
||||
out, err := exec.Command("/usr/sbin/rebuild_ro_part.sh").Output()
|
||||
|
||||
var ret_err error
|
||||
if err != nil {
|
||||
ret = fmt.Errorf("Rebuild RO Partition error: %s", err.Error())
|
||||
} else {
|
||||
ret = fmt.Errorf("Rebuild RO Partition success: %s", out)
|
||||
}
|
||||
|
||||
addSystemError(ret_err)
|
||||
}
|
||||
|
||||
// https://gist.github.com/alexisrobert/982674.
|
||||
// Copyright (c) 2010-2014 Alexis ROBERT <alexis.robert@gmail.com>.
|
||||
const dirlisting_tpl = `<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
@ -440,6 +454,7 @@ func managementInterface() {
|
|||
http.HandleFunc("/reboot", handleRebootRequest)
|
||||
http.HandleFunc("/getClients", handleClientsGetRequest)
|
||||
http.HandleFunc("/updateUpload", handleUpdatePostRequest)
|
||||
http.HandleFunc("/roPartitionRebuild", handleroPartitionRebuild)
|
||||
|
||||
err := http.ListenAndServe(managementAddr, nil)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue