forked from ProjectSegfault/publapi
add internal server error for some errors
This commit is contained in:
parent
2b3b221baf
commit
b8c03015ef
8
main.go
8
main.go
@ -106,17 +106,19 @@ func main() {
|
||||
}
|
||||
// Get the number of users online
|
||||
usersonline, err := exec.Command("bash", "-c", "/usr/bin/users").Output()
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return c.SendStatus(fiber.StatusInternalServerError)
|
||||
}
|
||||
usersonlinestr := string(usersonline)
|
||||
usersonlinededup := Dedup(usersonlinestr)
|
||||
outputa := int(strings.Count(usersonlinededup, " "))
|
||||
var output int
|
||||
output = outputa + 1
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
users, err2 := exec.Command("bash", "-c", "/usr/bin/ls /home").Output()
|
||||
if err2 != nil {
|
||||
log.Error(err2)
|
||||
return c.SendStatus(fiber.StatusInternalServerError)
|
||||
}
|
||||
userstr := string(users)
|
||||
userstr2 := strings.TrimSuffix(userstr, "\n")
|
||||
|
Loading…
Reference in New Issue
Block a user