diff --git a/roles/misc/ssh_tg_notify/templates/notify.sh b/roles/misc/ssh_tg_notify/templates/notify.sh index b1cc4e4..4161a17 100644 --- a/roles/misc/ssh_tg_notify/templates/notify.sh +++ b/roles/misc/ssh_tg_notify/templates/notify.sh @@ -21,7 +21,9 @@ if [[ "$PAM_SERVICE" == "sshd" && "$PAM_TYPE" == "open_session" && "$PAM_USER" ! if (( cache_mtime > (current_time - 4*60*60) )); then exit 0 fi + # define message text HOSTNAME=$(hostname --fqdn) TEXT="Successful login from [$IP](https://stat.ripe.net/app/$IP) for ${PAM_USER} @ ${HOSTNAME} ($(date "+%Y-%m-%d %H:%M"))" + # send to root sendMessage "$USERID" "$TEXT" fi