diff options
author | João Duarte <jvsDuarte08@gmail.com> | 2019-06-07 13:00:40 +0100 |
---|---|---|
committer | João Duarte <jvsDuarte08@gmail.com> | 2019-06-07 13:00:40 +0100 |
commit | cf25afe5b143eea8b1ca7d74462965d6e8184b2c (patch) | |
tree | e7284927e2087ad79aeffa1a3f36ed15611d2605 /prosodyctl | |
parent | 83ca8aef547856ab0caead6f9f999f642818de95 (diff) | |
download | prosody-cf25afe5b143eea8b1ca7d74462965d6e8184b2c.tar.gz prosody-cf25afe5b143eea8b1ca7d74462965d6e8184b2c.zip |
prosodyctl: Added the 'local_plugins' command function, which prints back a list of locally available plugins
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -87,10 +87,25 @@ local command = table.remove(arg, 1); function commands.test() show_message [[Well, hello there!]] - --show_message [[Enabled Plugins: ], modulemanager.get_modules_for_host()] show_warning("Trying to peek at the plugin directory: '%s'", modulemanager.get_modules_for_host()) end +function commands.local_plugins() + local directory = "./plugins" + local i, t, popen = 0, {}, io.popen + local pfile = popen('ls -a "'..directory..'"') + for filename in pfile:lines() do + if filename == "." or filename == ".." then + i = i + 1 + else + i = i + 1 + t[i] = filename + show_warning("%s", t[i]) + end + end + pfile:close() +end + function commands.adduser(arg) if not arg[1] or arg[1] == "--help" then show_usage([[adduser JID]], [[Create the specified user account in Prosody]]); |