Skip to content

Commit

Permalink
fix(root): remove check for static nethogs command
Browse files Browse the repository at this point in the history
  • Loading branch information
omarahm3 committed Sep 28, 2022
1 parent 592e7b7 commit b2a818e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
4 changes: 1 addition & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ func Init() {
os.Exit(1)
}

_, err := helpers.SnifferExists()
check(err)
db, err = buntdb.Open(getDbPath())
db, err := buntdb.Open(getDbPath())
check(err)
db.CreateIndex("apps", "*:app", buntdb.IndexString)
db.CreateIndex("processes", "*:process", buntdb.IndexString)
Expand Down
9 changes: 0 additions & 9 deletions pkg/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ const sniffer = "nethogs"

var ErrVnstatDoesNotExist = fmt.Errorf("'%s' does not exist on this machine or not exposed on current user $PATH", sniffer)

func SnifferExists() (bool, error) {
r := CommandExists("nethogs")
if !r {
return false, ErrVnstatDoesNotExist
}

return true, nil
}

func CommandExists(c string) bool {
_, err := exec.LookPath(c)
return err == nil
Expand Down

0 comments on commit b2a818e

Please sign in to comment.