mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
v-change-database-password-for-all-wordpress: first optional argument to specify a $user
This commit is contained in:
parent
5ee72684ab
commit
09465e5fba
1 changed files with 15 additions and 0 deletions
|
@ -15,6 +15,11 @@ source /etc/profile
|
||||||
# Includes
|
# Includes
|
||||||
source $VESTA/func/main.sh
|
source $VESTA/func/main.sh
|
||||||
|
|
||||||
|
only_user='';
|
||||||
|
if [ ! -z "$1" ]; then
|
||||||
|
only_user=$1
|
||||||
|
fi
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Action #
|
# Action #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
@ -26,6 +31,12 @@ for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$only_user" ]; then
|
||||||
|
if [ "$only_user" != "$user" ]; then
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
|
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
|
if [ -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
|
||||||
/usr/local/vesta/bin/v-change-database-password-for-wordpress $domain $user
|
/usr/local/vesta/bin/v-change-database-password-for-wordpress $domain $user
|
||||||
|
@ -33,6 +44,10 @@ for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ ! -z "$only_user" ]; then
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# cat /root/remember-db-user-pass.txt
|
# cat /root/remember-db-user-pass.txt
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue