misc/ssh_tg_notify: Add Content-Type to bot requests

master
Felix Stupp 2 years ago
parent 4da0a72682
commit b50f457d99
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -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

Loading…
Cancel
Save