From e9843b652e5bfe85f98c2864fcf89f800a50a745 Mon Sep 17 00:00:00 2001 From: oscarz Date: Tue, 18 Mar 2025 18:44:46 +0800 Subject: [PATCH] add scripts --- tools/aabook.monitor.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tools/aabook.monitor.sh diff --git a/tools/aabook.monitor.sh b/tools/aabook.monitor.sh new file mode 100644 index 0000000..515caee --- /dev/null +++ b/tools/aabook.monitor.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# 远程服务器信息 +REMOTE_SERVER="170.106.191.35" +REMOTE_USER="root" + +# 执行远程命令 +RESULT=$(ssh $REMOTE_USER@$REMOTE_SERVER "cd ~/resources/aabook/src/ && python3 ./check_status.py") + +# 检查远程命令执行结果 +if [ $? -eq 0 ]; then + # 执行本地脚本并将远程命令结果作为输入 + python3 ./send_to_wecom.py "$RESULT" +else + echo "远程命令执行失败" +fi + \ No newline at end of file