From 944d7c9ef9f7d93f13dc385ce5a486a9ecf9e63c Mon Sep 17 00:00:00 2001 From: Olen Date: Tue, 22 Sep 2020 14:34:01 +0200 Subject: [PATCH] List external commands in help. Allow reload of external commands (#12137) --- LibreNMS/IRCBot.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/LibreNMS/IRCBot.php b/LibreNMS/IRCBot.php index e21c217441..fae74e7a2a 100644 --- a/LibreNMS/IRCBot.php +++ b/LibreNMS/IRCBot.php @@ -657,10 +657,14 @@ class IRCBot //end _auth() - private function _reload() + private function _reload($params) { if ($this->user['level'] == 10) { - $new_config = Config::reload(); + if ($params == 'external') { + $this->respond('Reloading external scripts.'); + return $this->loadExternal(); + } + $new_config = Config::load(); $this->respond('Reloading configuration & defaults'); if ($new_config != $this->config) { return $this->__construct(); @@ -698,12 +702,11 @@ class IRCBot private function _help($params) { - foreach ($this->commands as $cmd) { - $msg .= ', ' . $cmd; + $msg = join(', ', $this->commands); + if (count($this->external) > 0) { + $msg .= ', '. join(', ', array_keys($this->external)); } - $msg = substr($msg, 2); - return $this->respond("Available commands: $msg"); }