moar stuff

This commit is contained in:
yigid balaban 2024-09-18 00:59:57 +03:00
parent 6922e7ca06
commit 87a95b9d76
Signed by: fyb
GPG Key ID: CF1BBD1336C0A3D6
6 changed files with 65 additions and 0 deletions

26
README.md Normal file
View File

@ -0,0 +1,26 @@
# server-toolset
## login mailer.sh
Get an email when someone logs in on your server.
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!
`install.sh` and `uninstall.sh` provided for ease-of-use, places systemctl service and timer, and enables it.
## credits
Feel free to contact me for collaboration on anything!
Yiğid BALABAN, <[fyb@fybx.dev][llmail]>
[My Website][llwebsite] • [My Bento][llbento] • [X][llx] • [LinkedIn][lllinkedin]
2024
[llmail]: mailto:fyb@fybx.dev
[llwebsite]: https://fybx.dev
[llbento]: https://bento.me/balaban
[llx]: https://x.com/fybalaban
[lllinkedin]: https://linkedin.com/in/fybx

7
install.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
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

7
login-mailer.service Normal file
View File

@ -0,0 +1,7 @@
[Unit]
Description=Login Mailer
[Service]
Type=simple
ExecStart=/root/server-toolset/login-mailer.sh

11
login-mailer.timer Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Chore Login Mailer
[Timer]
OnBootSec=1min
OnUnitActiveSec=1s
Unit=login-mailer.service
[Install]
WantedBy=timers.target

14
uninstall.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
systemctl stop login-mailer.timer
systemctl disable login-mailer.timer
if [ -f /etc/systemd/system/login-mailer.service ]; then
rm /etc/systemd/system/login-mailer.service
fi
if [ -f /etc/systemd/system/login-mailer.timer ]; then
rm /etc/systemd/system/login-mailer.timer
fi
systemctl daemon-reload