Commit 11801a89 authored by Andrey Filippov's avatar Andrey Filippov

Helper scripts for life-cycle management and MCP control of the program.

parent c6d346ea
...@@ -37,7 +37,7 @@ DEFAULT_QUEUE = REPO_ROOT / "attic" / "session-logs" / "eyesis-host-daemon" ...@@ -37,7 +37,7 @@ DEFAULT_QUEUE = REPO_ROOT / "attic" / "session-logs" / "eyesis-host-daemon"
CTL_SCRIPT = REPO_ROOT / "scripts" / "eyesis_mcp_ctl.sh" CTL_SCRIPT = REPO_ROOT / "scripts" / "eyesis_mcp_ctl.sh"
MCP_SCRIPT = REPO_ROOT / "scripts" / "mcp_http.sh" MCP_SCRIPT = REPO_ROOT / "scripts" / "mcp_http.sh"
ALLOWED_CTL = {"start", "stop", "restart", "status", "wait", "logs"} ALLOWED_CTL = {"start", "stop", "restart", "status", "wait"}
ALLOWED_MCP = {"status", "dialog", "button", "set", "submit", "interrupt", "confirm-stop"} ALLOWED_MCP = {"status", "dialog", "button", "set", "submit", "interrupt", "confirm-stop"}
......
...@@ -102,7 +102,7 @@ mcp_is_up() { ...@@ -102,7 +102,7 @@ mcp_is_up() {
mcp_request_exit() { mcp_request_exit() {
local helper="${REPO_ROOT}/scripts/mcp_http.sh" local helper="${REPO_ROOT}/scripts/mcp_http.sh"
if [[ -x "${helper}" ]]; then if [[ -x "${helper}" ]]; then
"${helper}" --timeout 5 button --label "Exit" >/dev/null "${helper}" button --timeout 5 --label "Exit" >/dev/null
return $? return $?
fi fi
curl -fsS --max-time 5 -X POST --data-urlencode "label=Exit" "$(mcp_base_url)/button" >/dev/null curl -fsS --max-time 5 -X POST --data-urlencode "label=Exit" "$(mcp_base_url)/button" >/dev/null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment