diff --git a/README.md b/README.md index c33b003..dce36f9 100644 --- a/README.md +++ b/README.md @@ -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 - diff --git a/install.sh b/install.sh index 8b418db..347c3a5 100644 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/login-mailer.service.template b/login-mailer.service.template index f248bbd..f2e0dad 100644 --- a/login-mailer.service.template +++ b/login-mailer.service.template @@ -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" diff --git a/uninstall.sh b/uninstall.sh index f8b26b8..47aeae7 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -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