1 Star 0 Fork 0

SIT-kite/kite-bot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
kite_server_status.py 379 Bytes
一键复制 编辑 原始数据 按行查看 历史
zzq 提交于 2022-09-23 13:20 . Add: 后端服务状态
import asyncio
import subprocess
async def invoke_simple_cmd(cmd: str) -> str:
proc = await asyncio.create_subprocess_shell(
cmd=cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
proc.stdin.writelines(['systemctl status kite2.service'.encode()])
out = await proc.stdout.read()
return out.decode()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/SIT-kite/kite-bot.git
[email protected]:SIT-kite/kite-bot.git
SIT-kite
kite-bot
kite-bot
master

搜索帮助