dump指令
This commit is contained in:
parent
61744c7886
commit
c33b8f0729
|
@ -80,3 +80,7 @@ func onStop() {
|
|||
func onCommand(command string) {
|
||||
|
||||
}
|
||||
|
||||
func onConfig() {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package src
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
|
@ -31,6 +32,8 @@ func Start() {
|
|||
daemonStop()
|
||||
case "status":
|
||||
daemonStatus()
|
||||
case "dump":
|
||||
dumpConfig()
|
||||
case "-s":
|
||||
daemonCommand()
|
||||
default:
|
||||
|
@ -154,6 +157,15 @@ func daemonStatus() {
|
|||
}
|
||||
}
|
||||
|
||||
func dumpConfig() {
|
||||
//config, err := json.Marshal(GetAppConfig())
|
||||
config, err := json.MarshalIndent(GetAppConfig(), "", " ")
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to marshal config: %v", err)
|
||||
}
|
||||
log.Println(string(config))
|
||||
}
|
||||
|
||||
/*
|
||||
守护进程接收名称
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user