使用shell脚本,利用群webhook机器人发送消息到企业微信群中,脚本支持文本,图片,文件 三种消息类型
需要用到jq命令,jq是一个json解析工具:jq官网#!/bin/bash
# Author:jinchuang [https://me.jinchuang.org/archives/986.html]
# 群webhook机器人发送消息到企业微信群
# webhook地址
url="https://qyapi.weixin.qq.com/cgi-bin/webhook"
# key
key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# header参数
header="'Content-Type:application/json'"
# 执行提示
function tips(){
if [ `jq -r .errcode` == "0" ];then echo -e "