UNPKG

knowhow-server

Version:

A personal workflow engine that can manage and use any network connected host

65 lines 1.64 kB
{ "id": "starts KH Agent", "working_dir": "/tmp/KHAgent", "options": { "timeoutms": 40000 }, "files": [], "shell": { "command": "ssh", "args": [ "-o", "StrictHostKeyChecking=no", "-o", "PreferredAuthentications=keyboard-interactive,password", "${USER}@${HOST}" ], "onConnect": { "timeoutms": 30000, "responses": { "[Pp]assword:": "${PASSWORD}" }, "waitForPrompt": "[#$]", "errorConditions": [ "timed out", "denied" ] }, "onExit": { "command": "exit\r\n" } }, "script": { "env": { "USER": "", "PASSWORD": "", "HOST": "", "PORT": "", "LOGIN": "", "AGENT_ID": "", "AGENT_DIR": "/tmp/${AGENT_ID}", "MODE": "production", "PASSWORD_ENC": "" }, "commands": [ { "command": "mkdir -p ${AGENT_DIR}" }, { "command": "cd ${AGENT_DIR}" }, { "command": "type startKHAgent >/dev/null 2>&1 || echo \"KHAgent is not installed\"; GLOBAL_INSTALL=\"false\"" }, { "command": "if [ -d \"knowhow-agent\" ]; then LOCAL_INSTALL=\"true\"; fi" }, { "command": "AGENT_ARGS=\"--port=${PORT} --user=${USER} --login=${LOGIN} --_id=${AGENT_ID} --mode=${MODE} --workingDir=./\"" }, { "command": "if [ -n \"${GLOBAL_INSTALL}\" ]; then nohup startKHAgent ${AGENT_ARGS} > /dev/null 2>&1& elif [ -n \"${LOCAL_INSTALL}\" ]; then node knowhow-agent/agent.js ${AGENT_ARGS}> /dev/null 2 >&1& fi" } ] } }