Commit 0992082 1 parent ef06ec7 commit 0992082 Copy full SHA for 0992082
File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package monitor
2
2
3
3
import (
4
4
cmd2 "github.com/reddec/tinc-boot/cmd"
5
+ "os"
5
6
"path/filepath"
6
7
"time"
7
8
)
@@ -19,7 +20,13 @@ type Config struct {
19
20
20
21
func (cfg * Config ) Events () * monitorEvents { return & cfg .events }
21
22
func (cfg * Config ) Root () string {
22
- r , err := filepath .Abs (cfg .Dir )
23
+ var dir = cfg .Dir
24
+ if cfg .Dir == "." {
25
+ if d , err := os .Getwd (); err == nil {
26
+ dir = d
27
+ }
28
+ }
29
+ r , err := filepath .Abs (dir )
23
30
if err != nil {
24
31
panic (err )
25
32
}
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ func (ms *service) Address() string { return ms.address }
115
115
func (ms * service ) reindexLoop () {
116
116
reindexTimer := time .NewTicker (ms .cfg .Reindex )
117
117
defer reindexTimer .Stop ()
118
+ ms .askForIndex ()
118
119
for {
119
120
select {
120
121
case <- ms .globalContext .Done ():
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const Extension = ".bat"
10
10
11
11
var TincUp = template .Must (template .New ("" ).Parse (`
12
12
netsh interface ipv4 set address name="%INTERFACE%" static {{.Addr}} {{.MaskAsAddr}} store=persistent
13
- cd "%~dp0r "
13
+ cd "%~dp0 "
14
14
start /B "" "{{.Bin}}" monitor
15
15
` ))
16
16
You can’t perform that action at this time.
0 commit comments