add scripts
This commit is contained in:
17
tools/aabook.monitor.sh
Normal file
17
tools/aabook.monitor.sh
Normal file
@ -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
|
||||
|
||||
Reference in New Issue
Block a user