|
|
@ -9,6 +9,8 @@ rocketchat_send() { |
|
|
|
_statusCode="$3" #0: success, 1: error 2($RENEW_SKIP): skipped |
|
|
|
_debug "_statusCode" "$_statusCode" |
|
|
|
|
|
|
|
_hostname=`hostname -f` |
|
|
|
|
|
|
|
ROCKETCHAT_WEBHOOK_URL="${ROCKETCHAT_WEBHOOK_URL:-$(_readaccountconf_mutable ROCKETCHAT_WEBHOOK_URL)}" |
|
|
|
if [ -z "$ROCKETCHAT_WEBHOOK_URL" ]; then |
|
|
|
ROCKETCHAT_WEBHOOK_URL="" |
|
|
@ -19,7 +21,7 @@ rocketchat_send() { |
|
|
|
_saveaccountconf_mutable ROCKETCHAT_WEBHOOK_URL "$ROCKETCHAT_WEBHOOK_URL" |
|
|
|
|
|
|
|
export _H1="Content-Type: application/json" |
|
|
|
_content="$(printf "*%s*\n%s" "$_subject" "$_content" | _json_encode)" |
|
|
|
_content="$(printf "*%s*\n%s" "$_subject on $_hostname" "$_content" | _json_encode)" |
|
|
|
_data="{\"text\": \"$_content\" }" |
|
|
|
|
|
|
|
response="$(_post "$_data" "$ROCKETCHAT_WEBHOOK_URL")" |
|
|
|