mirror of https://bitbucket.org/ausocean/av.git
Check for "Paused" mode when starting.
This commit is contained in:
parent
590136197b
commit
c01300eef6
|
@ -242,25 +242,29 @@ func main() {
|
|||
|
||||
var ns netsender.Sender
|
||||
var vs int
|
||||
paused := false
|
||||
|
||||
if *useNetsender {
|
||||
// initialize NetSender and use NetSender's logger
|
||||
config.Logger = netsender.Logger()
|
||||
|
||||
var err error
|
||||
err = ns.Init(nil, nil, nil)
|
||||
err := ns.Init(nil, nil, nil)
|
||||
if err != nil {
|
||||
l := smartlogger.New(loggerVerbosity, smartlogger.File, "/var/log/netsender/")
|
||||
l.Log(progName, "Error", err.Error()) // TODO(kortschak): Make this "Fatal" when that exists.
|
||||
config.Logger.Log(progName, "Error", err.Error()) // TODO(kortschak): Make this "Fatal" when that exists.
|
||||
os.Exit(1)
|
||||
}
|
||||
vars, _ := ns.Vars()
|
||||
if vars["mode"] == "Paused" {
|
||||
paused = true
|
||||
}
|
||||
} else {
|
||||
// alternatively, instantiate our own logger
|
||||
config.Logger = smartlogger.New(loggerVerbosity, smartlogger.File, "/var/log/netsender/")
|
||||
}
|
||||
|
||||
time.Sleep(prepTime)
|
||||
if !paused {
|
||||
startRevid()
|
||||
paused := false
|
||||
}
|
||||
|
||||
// loop in NetSender mode
|
||||
for *useNetsender {
|
||||
|
|
Loading…
Reference in New Issue