Skip to content

Commit 3bb7f72

Browse files
authored
Update update.go (#660)
* Update update.go * Update update.go
1 parent 1b963f3 commit 3bb7f72

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

correlation/rules/update.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package rules
33
import (
44
"log"
55
"os/exec"
6-
"path/filepath"
76
"time"
87

98
"github.com/utmstack/UTMStack/correlation/utils"
@@ -14,19 +13,18 @@ func Update(updateReady chan bool) {
1413
for {
1514
log.Println("Downloading rules")
1615
cnf := utils.GetConfig()
17-
clone := exec.Command("git", "clone", "https://github.com/AtlasInsideCorp/UTMStackCorrelationRules.git", cnf.RulesFolder+"system")
18-
_ = clone.Run()
1916

20-
pull := exec.Command("git", "pull")
21-
pull.Dir = filepath.Join(cnf.RulesFolder, "system")
22-
if err := pull.Run(); err != nil {
23-
log.Printf("Could not update ruleset: %v", err)
24-
}
17+
rm := exec.Command("rm", "-R", cnf.RulesFolder+"system")
18+
_ = rm.Run()
19+
20+
clone := exec.Command("git", "clone", "https://github.com/utmstack/rules.git", cnf.RulesFolder+"system")
21+
_ = clone.Run()
2522

2623
if first {
2724
first = false
2825
updateReady <- true
2926
}
27+
3028
log.Println("Rules updated")
3129
time.Sleep(24 * time.Hour)
3230
}

0 commit comments

Comments
 (0)