update start.sh
This commit is contained in:
parent
1308f99eff
commit
d7f11c122f
9
app.py
9
app.py
|
|
@ -10,7 +10,8 @@ logging.basicConfig(level=logging.INFO)
|
||||||
logging.info("服务器启动")
|
logging.info("服务器启动")
|
||||||
|
|
||||||
VNC_SERVER_HOST = "https://10.10.40.19:6080"
|
VNC_SERVER_HOST = "https://10.10.40.19:6080"
|
||||||
# @mcp.tool()
|
SHELL_DIR = "/home/dgs/vnc-server"
|
||||||
|
@mcp.tool()
|
||||||
def mail_qq_spider(account: str) -> str:
|
def mail_qq_spider(account: str) -> str:
|
||||||
"""qq邮箱爬虫,第一个参数是用户名"""
|
"""qq邮箱爬虫,第一个参数是用户名"""
|
||||||
return a1(account)
|
return a1(account)
|
||||||
|
|
@ -25,7 +26,7 @@ async def start_vnc_server(display: int) -> str:
|
||||||
try:
|
try:
|
||||||
# 调用外部 start_vnc_server.sh 脚本,传入 index 作为参数
|
# 调用外部 start_vnc_server.sh 脚本,传入 index 作为参数
|
||||||
process = await asyncio.create_subprocess_exec(
|
process = await asyncio.create_subprocess_exec(
|
||||||
"/home/dgs/vnc-server/start_vnc_server.sh",
|
f"{SHELL_DIR}/start_vnc_server.sh",
|
||||||
str(display),
|
str(display),
|
||||||
stdout=asyncio.subprocess.PIPE,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
stderr=asyncio.subprocess.PIPE
|
stderr=asyncio.subprocess.PIPE
|
||||||
|
|
@ -55,7 +56,7 @@ async def start_spider(spider_code: str,display: str) -> str:
|
||||||
try:
|
try:
|
||||||
# 调用外部 start_spider.sh 脚本,传入 spider_code 作为参数
|
# 调用外部 start_spider.sh 脚本,传入 spider_code 作为参数
|
||||||
process = await asyncio.create_subprocess_exec(
|
process = await asyncio.create_subprocess_exec(
|
||||||
"/home/dgs/vnc-server/start_spider.sh",
|
f"{SHELL_DIR}/start_spider.sh",
|
||||||
spider_code,
|
spider_code,
|
||||||
display,
|
display,
|
||||||
stdout=asyncio.subprocess.PIPE,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
|
|
@ -82,7 +83,7 @@ async def close_vnc_server(display: int) -> str:
|
||||||
try:
|
try:
|
||||||
# 调用外部 close_vnc_server.sh 脚本,传入 display 作为参数
|
# 调用外部 close_vnc_server.sh 脚本,传入 display 作为参数
|
||||||
process = await asyncio.create_subprocess_exec(
|
process = await asyncio.create_subprocess_exec(
|
||||||
"/home/dgs/vnc-server/close_vnc_server.sh",
|
f"{SHELL_DIR}/close_vnc_server.sh",
|
||||||
str(display),
|
str(display),
|
||||||
stdout=asyncio.subprocess.PIPE,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
stderr=asyncio.subprocess.PIPE
|
stderr=asyncio.subprocess.PIPE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue