mirror of
https://github.com/guezoloic/serverconfig.git
synced 2026-01-25 12:34:24 +00:00
16 lines
395 B
Bash
16 lines
395 B
Bash
#!bin/bash
|
|
|
|
source /usr/local/bin/notifications.sh
|
|
|
|
case "$PAM_TYPE" in
|
|
open_session)
|
|
PAYLOAD=" { \"text\": \"$PAM_USER logged in (remote host: $PAM_RHOST) at $(date).\" }"
|
|
;;
|
|
close_session)
|
|
PAYLOAD=" { \"text\": \"$PAM_USER logged out (remote host: $PAM_RHOST) at $(date).\" }"
|
|
;;
|
|
esac
|
|
|
|
if [ -n "$PAYLOAD" ] ; then
|
|
send_notification "$PAYLOAD"
|
|
fi |