CasperSecurity

Current Path : /usr/local/bin/
Upload File :
Current File : //usr/local/bin/check_apache.sh

#!/bin/bash

# Define the service to check
APACHE_SERVICE="apache2"

# URL to check for website health. Should be a reliable page.
# We will check if we can download the main UIET homepage.
URL_TO_CHECK="https://uiet.co.in"

# Check if the site is reachable using curl
# The --max-time 5 flag ensures curl gives up after 5 seconds if the site is down
# The -s -f flags make curl silent and fail on server errors
if ! curl -s -f --max-time 5 "$URL_TO_CHECK" > /dev/null
then
    # If the curl command fails, the site is down. Restart Apache.
    echo "$(date): Website check failed for $URL_TO_CHECK. Restarting Apache..." >> /var/log/apache_watchdog.log
    systemctl restart "$APACHE_SERVICE"
    echo "$(date): Apache restarted via watchdog." >> /var/log/apache_watchdog.log
fi
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY