From 91f6ae080a0e1c1133d4e0b86a8a0dfdb97217a9 Mon Sep 17 00:00:00 2001 From: isscbta <53144593+isscbta@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:01:09 +0100 Subject: [PATCH] Update Wordfence WAF Path --- bin/v-move-domain-and-database-to-account | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/bin/v-move-domain-and-database-to-account b/bin/v-move-domain-and-database-to-account index 7524d229..6ed2f6d8 100644 --- a/bin/v-move-domain-and-database-to-account +++ b/bin/v-move-domain-and-database-to-account @@ -88,6 +88,40 @@ if [ $? -ne 0 ]; then RET=$E_NOTEXIST fi +#----------------------------------------------------------# +# Update Wordfence WAF Path # +#----------------------------------------------------------# + +# Path to .user.ini file +user_ini="$USER_DATA/web/$domain/public_html/.user.ini" + +# Check if .user.ini exists +if [ -f "$user_ini" ]; then + echo "Updating .user.ini with new user path..." + + # Temporary file for modification + tmp_file=$(mktemp) + + # Change path from old USER to new USER_TO + sed "s|/home/$owner/public_html|/home/$USER_TO/public_html|g" "$user_ini" > "$tmp_file" + + # Check if replacement was successful and update .user.ini + if [ $? -eq 0 ]; then + mv "$tmp_file" "$user_ini" + echo ".user.ini updated successfully." + else + echo "Failed to update .user.ini file." + rm "$tmp_file" # Deletes temporary file + fi +else + echo ".user.ini does not exist, no changes made." +fi + +#----------------------------------------------------------# +# Exit # +#----------------------------------------------------------# + + #----------------------------------------------------------# # Vesta # #----------------------------------------------------------#