File: //scripts/checkMail.sh
#!/bin/bash
URL="https://mail.karmanye.in:8443/webmail/"
keyword="Webmail"
if curl -sSf --max-time 10 "$URL" | grep "$keyword"
then
# if the keyword is in the content
echo "Website is working fine"
else
echo "Error"
# cd /data/whatsapp/platform-api/whatsapp-api-staging
# docker-compose restart
service docker restart
curl --location --request POST 'https://marketing.wp.karmanye.in/api/Karmanye/send-message' --header 'Content-Type: application/json; charset=utf-8' --header 'Accept: application/json' --header 'Authorization: Bearer $2b$10$f7yAQHm3Y1eOxs92aiEJ9eohJ0AdUQ2YwXxUARzk3sVLgKIVw0k2q' -d '{ "phone": "919033595842", "message": "*Error Genereted Karmanye Mail*"}'
fi