misc/ssh_tg_notify: Include username into cache key

- So if multiple users log in from the same ip, the cache does not prevent a notification
master
Felix Stupp 2 years ago
parent a2091da6a9
commit 27bd516581
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -10,7 +10,7 @@ TIMEOUT={{ timeout | quote }}
URL="https://api.telegram.org/bot$KEY/sendMessage"
if [[ "$PAM_SERVICE" == "sshd" && "$PAM_TYPE" == "open_session" && "$PAM_USER" != "git" && -z "$TMUX" ]]; then
IP="$PAM_RHOST"
cache_file="$CACHE_DIR/$IP"
cache_file="${CACHE_DIR}/${IP}-${PAM_USER}"
cache_mtime=$(stat --format="%Y" "$cache_file")
current_time=$(date +%s)
touch "$cache_file"

Loading…
Cancel
Save