mirror of https://github.com/velour/catbase.git
admin: add reboot command
This commit is contained in:
parent
d0998d0a63
commit
21d4b11df9
|
@ -7,6 +7,7 @@ import (
|
|||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -66,6 +67,11 @@ func (p *AdminPlugin) message(conn bot.Connector, k bot.Kind, message msg.Messag
|
|||
return false
|
||||
}
|
||||
|
||||
if strings.ToLower(body) == "reboot" {
|
||||
log.Info().Msgf("Got reboot command")
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if strings.ToLower(body) == "shut up" {
|
||||
dur := time.Duration(p.cfg.GetInt("quietDuration", 5)) * time.Minute
|
||||
log.Info().Msgf("Going to sleep for %v, %v", dur, time.Now().Add(dur))
|
||||
|
|
Loading…
Reference in New Issue