File: //scripts/checkStorageWeb.sh
#!/bin/bash
URL="https://storage.karmanye.in/login"
keyword="Karmanye Cloud"
if curl -sSf --max-time 5 "$URL" | grep "$keyword"
then
# if the keyword is in the content
echo "Storage Web is working fine"
else
echo "Resolving Storage Web Issue"
cd /root
cp /root/storage-privkey.pem /etc/letsencrypt/live/storage.karmanye.in/privkey.pem
cp /root/storage-fullchain.pem /etc/letsencrypt/live/storage.karmanye.in/fullchain.pem
service lsws restart
# cd /data/silvera_rojmel_db
# docker-compose down
# service docker restart
# docker-compose up -d --build --remove-orphans
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": "*storage.karmanye.in Website not working, Restarted Service*"}'
fi