diff --git a/roles/misc/ssh_tg_notify/templates/notify.sh b/roles/misc/ssh_tg_notify/templates/notify.sh index 1c50c54..812c1a5 100644 --- a/roles/misc/ssh_tg_notify/templates/notify.sh +++ b/roles/misc/ssh_tg_notify/templates/notify.sh @@ -9,7 +9,7 @@ TIMEOUT={{ timeout | quote }} URL="https://api.telegram.org/bot$KEY/sendMessage" sendMessage() { - curl -s --max-time "$TIMEOUT" -d "chat_id=$1" -d "disable_web_page_preview=1" -d "parse_mode=Markdown" -d "text=$2" "$URL" >/dev/null + curl -s --max-time "$TIMEOUT" -H "Content-Type: application/x-www-form-urlencoded" -d "chat_id=$1" -d "disable_web_page_preview=1" -d "parse_mode=Markdown" -d "text=$2" "$URL" >/dev/null } if [[ "$PAM_SERVICE" == "sshd" && "$PAM_TYPE" == "open_session" && "$PAM_USER" != "git" && -z "$TMUX" ]]; then