aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl/shell.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/prosodyctl/shell.lua')
-rw-r--r--util/prosodyctl/shell.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/prosodyctl/shell.lua b/util/prosodyctl/shell.lua
index d6d885d8..a0fbb09c 100644
--- a/util/prosodyctl/shell.lua
+++ b/util/prosodyctl/shell.lua
@@ -64,6 +64,13 @@ local function printbanner()
print("https://prosody.im/doc/console\n");
end
+local function check()
+ local lfs = require "lfs";
+ local socket_path = path.resolve_relative_path(prosody.paths.data, config.get("*", "admin_socket") or "prosody.sock");
+ local state = lfs.attributes(socket_path, "mode");
+ return state == "socket";
+end
+
local function start(arg) --luacheck: ignore 212/arg
local client = adminstream.client();
local opts, err, where = parse_args(arg);
@@ -180,4 +187,5 @@ end
return {
shell = start;
+ available = check;
};