mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Update Wordfence WAF Path
This commit is contained in:
parent
328f6f293c
commit
91f6ae080a
1 changed files with 34 additions and 0 deletions
|
@ -88,6 +88,40 @@ if [ $? -ne 0 ]; then
|
||||||
RET=$E_NOTEXIST
|
RET=$E_NOTEXIST
|
||||||
fi
|
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 #
|
# Vesta #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue