-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
49 lines (42 loc) · 1.02 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh -l
set -e # if a command fails it stops the execution
set -u # script fails if trying to access to an undefined variable
# Starts processes
PROVIDER="$1"
WEB_HOOK_URL="$2"
TOKEN="$3"
CHANNEL_ID="$4"
CHAT_ID="$5"
CONNECTION_URL="$6"
THREAD_ID="$7"
REQUIRED_FAILED=$8
SMTP_HOST="$9"
SMTP_PORT="$10"
SMTP_USE_TLS=$11
SMTP_USE_STARTTLS=$12
SMTP_USER="$13"
SMTP_PASSWORD="$14"
SMTP_SUBJECT="$15"
SMTP_FROM="$16"
SMTP_TO="$17"
MESSAGE="$18"
export PROVIDER=$PROVIDER
export WEB_HOOK_URL=$WEB_HOOK_URL
export TOKEN=$TOKEN
export CHANNEL_ID=$CHANNEL_ID
export CHAT_ID=$CHAT_ID
export CONNECTION_URL=$CONNECTION_URL
export SMTP_HOST=$SMTP_HOST
export SMTP_PORT=$SMTP_PORT
export SMTP_USE_TLS=$SMTP_USE_TLS
export SMTP_USE_STARTTLS=$SMTP_USE_STARTTLS
export SMTP_USER=$SMTP_USER
export SMTP_PASSWORD=$SMTP_PASSWORD
export SMTP_SUBJECT=$SMTP_SUBJECT
export SMTP_FROM=$SMTP_FROM
export SMTP_TO=$SMTP_TO
chatz -o --from-env -t=$THREAD_ID "$MESSAGE"
# Check REQUIRED_FAILED
if [ "${REQUIRED_FAILED:-false}" = "true" ]; then
exit 1
fi