-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsshrc
More file actions
30 lines (27 loc) · 1.16 KB
/
sshrc
File metadata and controls
30 lines (27 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# /etc/ssh/sshrc
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
curl --silent -v \
-H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"- @ \`$USER\`\n - IP \`$ip\`\"}" \
https://discord.com/api/webhooks/0000000000000000000/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > /dev/null 2>&1
{
echo "From: sshrc@altherneum.fr"
echo "To: root@altherneum.fr"
echo "Subject: SSHRC - $ip $USER"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html; charset="UTF-8""
echo "<br>"
echo "<html><body>"
echo "<img src="https://doc.altherneum.fr/assets/gif/banner.gif" alt='Banner' style='width: 80%; border-radius: 25px; margin-left: 5%;'>"
echo "<br><br>"
echo "<h1 style='text-decoration: underline;'>Bonjour,</h1><br>"
echo "Cet e-mail est un <b style='text-decoration: underline;'>alerte de connexion automatique</b>.<br>"
echo "<br><br>"
echo "$ip $USER<br>"
echo "<br><br>"
echo "Cordialement,<br>"
echo "- L'administrateur d'Altherneum.fr<br><br>"
echo "<img src="https://doc.altherneum.fr/assets/gif/small.gif" alt='Banner-footer' style='border-radius: 50%; width: 100px;'>"
echo "</body></html>"
} | /usr/lib/sendmail -t