-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcmd.sh
37 lines (31 loc) · 1.21 KB
/
cmd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
exec sudo -E bash -c 'supervisord -c /etc/supervisord.conf -l /var/log/supervisord.log' &
sleep 10
if [ -d "/home/app/.wine/drive_c/Program Files/Tencent" ]; then
echo '启动64位微信'
wine 'C:\Program Files\Tencent\WeChat\WeChat.exe' &
else
echo '启动32位微信'
wine 'C:\Program Files (x86)\Tencent\WeChat\WeChat.exe' &
fi
sleep 10
wine 'C:\DllInjector.exe' 'C:\wxhelper.dll' WeChat.exe 2>&1
# 判断是否配置回调
if [ $NOTIFY_URL ];then
sleep 10
echo "开始发送注入后的回调通知: $NOTIFY_URL"
status = "success"
# 使用netstat检测端口是否被监听
netstat -an | grep 19088 > /dev/null
if [ $? -eq 0 ];then
echo "HOOK 注入成功,19088端口正在监听"
else
echo "HOOK 疑似注入失败,19088 端口未监听,请手动检查是否注入成功"
status = "fail"
fi
curl -X POST $NOTIFY_URL -H 'Content-Type: application/json' -d '{"status": "'"$status"'", "robot": "'"$REMARK"'", "apiHost": "'"$API"'"}'
else
echo "未配置回调通知地址,跳过通知消息发送"
echo "如果需要,请配置NOTIFY_URL、REMARK、API三个环境变量,它们分别是通知地址、机器人备注、外部请求机器人的API地址"
fi
wait