#!/bin/sh


#@所有人
#'isAtAll': true


webhook='https://oapi.dingtalk.com/robot/send?access_token=xxx'
#钉钉机器人设置的关键字
cluster='alarm'
#钉钉@的人
#atMobiles='"176xxx","132xxx"'
atMobiles='"1760581xxx"'
msg=$1
msg2=$2
 
function SendMsgToDingding() {
  curl $webhook -H 'Content-Type: application/json' -d "
  {
    'msgtype': 'text',
    'text': {
      'content': '$cluster\n $msg\n $msg2'
    },
    'at': {
      'atMobiles': [${atMobiles}]
    }
  }"
}
SendMsgToDingding


脚本运行:]#./dingding.sh 第一段文字 第二段文字