cleaner, simpler & better

This commit is contained in:
yigid balaban 2024-10-31 19:23:17 +03:00
parent 2060174be5
commit fc5f10d4dd
Signed by: fyb
GPG Key ID: CF1BBD1336C0A3D6
4 changed files with 10 additions and 4 deletions

View File

@ -2,7 +2,7 @@
## login-mailer.sh
Get an email when someone logs in on your server.
Get an email when someone logs in on your server. Depends on `rsyslog` and `/var/log/auth.log`.
Requires you to host/use an email proxy. See [git.fybx.dev/fyb/mail-proxy](https://git.fybx.dev/fyb/mail-proxy) for a simple Express.js and nodemailer powered alternative. Fork and deploy to Vercel, it's set!
@ -25,4 +25,3 @@ Yiğid BALABAN, <[fyb@fybx.dev][llmail]>
[llbento]: https://bento.me/balaban
[llx]: https://x.com/fybalaban
[lllinkedin]: https://linkedin.com/in/fybx

View File

@ -1,7 +1,10 @@
#!/bin/bash
cp ./login-mailer.sh /usr/local/bin/login-mailer
cp ./login-mailer.service /etc/systemd/system/login-mailer.service
cp ./login-mailer.timer /etc/systemd/system/login-mailer.timer
systemctl daemon-reload
systemctl enable --now login-mailer.timer
systemctl status login-mailer.timer

View File

@ -1,8 +1,8 @@
[Unit]
Description=Login Mailer
Description=Get mailed when someone logs in to your server!
[Service]
Type=simple
ExecStart=/root/server-toolset/login-mailer.sh
ExecStart=/usr/local/bin/login-mailer
Environment="EMAIL=your_email@example.org"
Environment="ENDPOINT=mail.example.org/api/mail"

View File

@ -3,6 +3,10 @@
systemctl stop login-mailer.timer
systemctl disable login-mailer.timer
if [ -f /usr/local/bin/login-mailer ]; then
rm /usr/local/bin/login-mailer
fi
if [ -f /etc/systemd/system/login-mailer.service ]; then
rm /etc/systemd/system/login-mailer.service
fi