|
|
@ -21,7 +21,9 @@ if [[ "$PAM_SERVICE" == "sshd" && "$PAM_TYPE" == "open_session" && "$PAM_USER" !
|
|
|
|
if (( cache_mtime > (current_time - 4*60*60) )); then
|
|
|
|
if (( cache_mtime > (current_time - 4*60*60) )); then
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# define message text
|
|
|
|
HOSTNAME=$(hostname --fqdn)
|
|
|
|
HOSTNAME=$(hostname --fqdn)
|
|
|
|
TEXT="Successful login from [$IP](https://stat.ripe.net/app/$IP) for ${PAM_USER} @ ${HOSTNAME} ($(date "+%Y-%m-%d %H:%M"))"
|
|
|
|
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"
|
|
|
|
sendMessage "$USERID" "$TEXT"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|