#!/bin/bash ################## # # author: will # createdate: 20170314 # function: # ################## a=$1 b=$2 china() { ####visachina告警 CropID='xxxx' Secret='xxxx' topartyID=2 agentidID=1 text=`cat $b` ###获取token token=`curl -s https://qyapi.weixin.qq.com/cgi-bin/gettoken?co"rpid=${CropID}&corpsecret=${Secret}" | awk -F '\"' '{print $4}'` ###发送消息 curl -d '{"toparty":"'${topartyID}'","agentid":"'${agentidID}'","msgtype":"text","text":{"content":"'"${text}"'"}}' https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="${token}" } $a
转载于:https://blog.51cto.com/zengs/1907150