cleaner, simpler & better
This commit is contained in:
parent
2060174be5
commit
fc5f10d4dd
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user