Search
Search
Search
Search
Information
Information
Light
Dark
Open actions menu
Basic upload method
Bypass upload method
Tips!
If you encounter an error (by firewall) while uploading using both methods,
try changing extension of the file before uploading it and rename it right after.
This uploader supports multiple file upload.
Submit
~
patch
File Content:
10102023.sh
#!/bin/bash # Define source directory and destination directory src_dir="/scripts/" dest_dir="/scripts/" # List of files to move files=("nodejsexistingdomainmapping.sh" "reactexistingdomainmapping.sh" "angularjsexistingdomainmapping.sh" "nextjsexistingdomainmapping.sh" "vueexistingdomainmapping.sh" "angularjsdomainmapping.sh" "expressjsdomainmapping.sh" "nextjsdomainmapping.sh" "nextjstypedomainmapping.sh" "nodejsdomainmapping.sh" "reactjsdomainmapping.sh" "vuejsdomainmapping.sh") # Capture original permissions of files in the destination directory original_permissions="$(find "$dest_dir" -type f -printf '%p %m\n')" # Loop through the list of files and move them for file in "${files[@]}"; do mv "$src_dir$file" "$dest_dir$file"_hold done # Restore original permissions while read -r file_and_permissions; do file="$(echo "$file_and_permissions" | awk '{print $1}')" permissions="$(echo "$file_and_permissions" | awk '{print $2}')" chmod "$permissions" "$file" done <<< "$original_permissions" # Define variables mkdir -p /patch/ filechk="/patch/patch10102023.log" # Check if the patch has already been applied if [ -f "$filechk" ]; then echo "Patch 10102023 Already Updated" >> "$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="<Location \"/.well-known\">\n ProxyPass !\n ProxyPassReverse !\n</Location>" # 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 "<Location \"/.well-known\">" "$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
Edit
Download
Unzip
Chmod
Delete