Forked from idflorin/aaPanel cron job for email server on Debian 10
Last active
January 18, 2024 02:35
-
-
Save mdestafadilah/b862c95f12790b31b2cedc6ee184ab9c to your computer and use it in GitHub Desktop.
Cron job for aapanel check systemctl status dovecot rspamd postfix telegram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVICE="dovecot" | |
if (systemctl is-active $SERVICE) | |
then | |
echo "$SERVICE is running" | |
# curl -s "https://api.telegram.org/bot5233333629:AXDDDDDDDxqVTr_SWhh8SGo/sendMessage?chat_id=17522222222208&text='$SERVICE is running'" | |
else | |
echo "$SERVICE stopped" | |
# curl -s "https://api.telegram.org/bot5233333629:AXDDDDDDDxqVTr_SWhh8SGo/sendMessage?chat_id=17522222222208&text='$SERVICE 193.187.129.202:31202/b066ea5s6m202 stopped!!!'" | |
# uncomment to start rspamd if stopped | |
systemctl start dovecot | |
fi | |
#!/bin/bash | |
SERVICE="rspamd" | |
if (systemctl is-active $SERVICE) | |
then | |
echo "$SERVICE is running" | |
# curl -s "https://api.telegram.org/bot5233333629:AXDDDDDDDxqVTr_SWhh8SGo/sendMessage?chat_id=17522222222208&text='$SERVICE is running'" | |
else | |
echo "$SERVICE stopped" | |
# curl -s "https://api.telegram.org/bot5233333629:AXDDDDDDDxqVTr_SWhh8SGo/sendMessage?chat_id=17522222222208&text='$SERVICE 193.187.129.202:31202/b066ea5s6m202 stopped!!!'" | |
# uncomment to start rspamd if stopped | |
systemctl start rspamd | |
fi | |
#!/bin/bash | |
SERVICE="postfix" | |
if (systemctl is-active $SERVICE) | |
then | |
echo "$SERVICE is running" | |
# curl -s "https://api.telegram.org/bot5233333629:AXDDDDDDDxqVTr_SWhh8SGo/sendMessage?chat_id=17522222222208&text='$SERVICE is running'" | |
else | |
echo "$SERVICE stopped" | |
# curl -s "https://api.telegram.org/bot5233333629:AXDDDDDDDxqVTr_SWhh8SGo/sendMessage?chat_id=17522222222208&text='$SERVICE 193.187.129.202:31202/b066ea5s6m202 stopped!!!'" | |
# uncomment to start dovecot if stopped | |
systemctl start postfix | |
fi | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment