Last active
January 18, 2024 02:33
-
-
Save idflorin/2b11f7f1d2d2ac3d856f63697997d534 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 -q $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 -q $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 -q $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