sendmsg.sh 856 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. nowdate=$1
  3. content=${@:2}
  4. content=${content//\<font color=\'red\'\>/}
  5. content=${content//\<\/font\>\<\/br\>/}
  6. content=${content//\ /}
  7. echo "warn content is : $content"
  8. api=https://open.feishu.cn/open-apis/bot/v2/hook/00cf9bb4-ecea-4f0d-bf02-1a20592a916c #飞书机器人webhook 地址
  9. curl -X POST \
  10. $api \
  11. -H 'Content-Type: application/json' \
  12. -d '{
  13. "msg_type": "post",
  14. "content": {
  15. "post": {
  16. "zh_cn": {
  17. "title": "recall alert",
  18. "content": [
  19. [
  20. {
  21. "tag": "text",
  22. "un_escape": true,
  23. "text": "'$content'"
  24. }
  25. ],
  26. [
  27. ]
  28. ]
  29. }
  30. }
  31. }
  32. }'