mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 06:40:26 +08:00
增加service命令
This commit is contained in:
@@ -22,7 +22,7 @@ func main() {
|
||||
app := apps.NewAppCmd()
|
||||
app.Version(teaconst.Version)
|
||||
app.Product(teaconst.ProductName)
|
||||
app.Usage(teaconst.ProcessName + " [start|stop|restart|setup|upgrade]")
|
||||
app.Usage(teaconst.ProcessName + " [start|stop|restart|setup|upgrade|service|daemon]")
|
||||
app.On("setup", func() {
|
||||
setupCmd := setup.NewSetupFromCmd()
|
||||
err := setupCmd.Run()
|
||||
@@ -56,6 +56,16 @@ func main() {
|
||||
}
|
||||
fmt.Println("finished!")
|
||||
})
|
||||
app.On("daemon", func() {
|
||||
nodes.NewAPINode().Daemon()
|
||||
})
|
||||
app.On("service", func() {
|
||||
err := nodes.NewAPINode().InstallSystemService()
|
||||
if err != nil {
|
||||
fmt.Println("[ERROR]install failed: " + err.Error())
|
||||
}
|
||||
fmt.Println("done")
|
||||
})
|
||||
app.Run(func() {
|
||||
nodes.NewAPINode().Start()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user