dockerfiles/sendxmpp/entrypoint.sh

32 lines
638 B
Bash
Raw Normal View History

2022-08-22 18:28:36 +02:00
#!/bin/sh
MESSAGE="${MESSAGE:-${PLUGIN_MESSAGE}}"
if [ -z "$MESSAGE" ]; then
echo "'message' must specified"
exit 1
fi
USERNAME="${USERNAME:-${PLUGIN_USERNAME}}"
if [ -z "$USERNAME" ]; then
echo "'username' must specified"
exit 1
fi
PASSWORD="${PASSWORD:-${PLUGIN_PASSWORD}}"
if [ -z "$USERNAME" ]; then
echo "'username' must specified"
exit 1
fi
RECIPIENT="${RECIPIENT:-${PLUGIN_RECIPIENT}}"
if [ -z "$RECIPIENT" ]; then
echo "'recipient' must specified"
exit 1
fi
exec echo "$MESSAGE" | \
go-sendxmpp \
--username="${USERNAME}"\
--password="${PASSWORD}" \
"${RECIPIENT}"