mirror of
https://github.com/myvesta/vesta
synced 2025-07-07 13:31:53 -07:00
v-change-db-password-to-wordpress
This commit is contained in:
parent
c5d0619a6b
commit
2fe4ce2ae4
2 changed files with 143 additions and 0 deletions
43
bin/v-change-db-password-to-all-wordpress
Normal file
43
bin/v-change-db-password-to-all-wordpress
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
# info: change db password to all wordpress databases
|
||||
# options:
|
||||
#
|
||||
# The command is used for changing db password to all wordpress databases on the server.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Importing system variables
|
||||
source /etc/profile
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
|
||||
if [ ! -f "/usr/local/vesta/data/users/$user/user.conf" ]; then
|
||||
continue;
|
||||
fi
|
||||
|
||||
for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
|
||||
if [ -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
|
||||
/usr/local/vesta/bin/v-change-db-password-to-wordpress $domain
|
||||
echo "--------------------------------"
|
||||
fi
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue