add full path for users and wc binary

This commit is contained in:
Arya Kiran 2023-01-07 22:26:25 +05:30
parent 41ecec808c
commit 40829dfbe9
No known key found for this signature in database
GPG Key ID: 3A6EA2D0EE314EEF

View File

@ -23,7 +23,7 @@ func main() {
app.Get("/online", func(c *fiber.Ctx) error { app.Get("/online", func(c *fiber.Ctx) error {
// Get the number of users online // Get the number of users online
out, err := exec.Command("users | wc -l").Output() out, err := exec.Command("/usr/bin/users | /usr/bin/wc -l").Output()
if err != nil { if err != nil {
log.Error(err) log.Error(err)
return c.SendStatus(fiber.StatusInternalServerError) return c.SendStatus(fiber.StatusInternalServerError)