From 10e2dea52a4fa4764995190710474bf4aefa2185 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sat, 3 Sep 2022 14:39:29 +0200 Subject: [PATCH] misc/ssh_tg_notify: Add comments for sections --- roles/misc/ssh_tg_notify/templates/notify.sh | 2 ++ 1 file changed, 2 insertions(+) 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