notification/templates/sendmail-login.sh
2023-02-18 09:22:41 +03:00

15 lines
626 B
Bash

#! /bin/sh
(
python3 /usr/local/bin/sendmail.py \
-u "$(cat /usr/local/bin/sendmail.config | grep "from=" | cut -d= -f2)" \
-p "$(cat /usr/local/bin/sendmail.config | grep "pass=" | cut -d= -f2)" \
-d "$(cat /usr/local/bin/sendmail.config | grep "dest=" | cut -d= -f2)" \
--smtp "$(cat /usr/local/bin/sendmail.config | grep "smtp=" | cut -d= -f2)" \
--port "$(cat /usr/local/bin/sendmail.config | grep "port=" | cut -d= -f2)" \
--stls "True" \
--subj "[Authorization] $(cat /etc/hostname): user logged in system" \
--text "$(w)" \
>> /dev/null 2>&1 &
)