-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevo.go
More file actions
51 lines (42 loc) · 910 Bytes
/
devo.go
File metadata and controls
51 lines (42 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"fmt"
"os"
"github.com/arnopensource/devo/cli"
"github.com/arnopensource/devo/daemon"
)
const devoConfigFile = "devo.toml"
func main() {
// Hijack execution flow in child process
daemon.RunDaemon(devoConfigFile)
if uid := os.Getuid(); uid == 0 {
fmt.Println("Devo can't run as root for now")
return
}
// Cli mode
err := cli.Run(os.Args[1:], devoConfigFile)
if err != nil {
fmt.Println(err)
}
// Dev mode
//conf, err := config.Parse(devoConfigFile)
//if err != nil {
// panic(err)
//}
//
//process, err := daemon.GetProcess(conf)
//if err != nil {
// fmt.Println("Could not find daemon:", err)
//} else {
// err = daemon.KillProcess(process)
// if err != nil {
// fmt.Println("Could not kill daemon:", err)
// }
// fmt.Println("Stopped daemon")
//}
//
//time.Sleep(1 * time.Second)
//
//fmt.Println("Starting daemon")
//daemon.Fork(conf)
}