dockerfiles--matrixorg-aler.../bin/bot

15 lines
342 B
Plaintext
Raw Normal View History

2020-09-29 08:52:25 +00:00
#!/bin/bash
if [[ ! -f /var/opt/mtx-alert-auth ]]; then
echo 'E| you must set the bot auth token on "/var/opt/mtx-alert-auth"'
exit 1
fi
IN=$1
if [[ $1 == '' ]]; then
IN=$(timeout 1 cat /dev/stdin)
fi
AUTH=$(cat /var/opt/mtx-alert-auth)
curl -X POST "http://localhost:8080/?auth=$AUTH" -d "message=$IN" 2>/dev/null