mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
v-change-database-password-for-wordpress: fixing a bug in temporary password storage
This commit is contained in:
parent
403dd65400
commit
a976a3bc3f
2 changed files with 8 additions and 3 deletions
|
@ -51,7 +51,9 @@ for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
|
|||
done
|
||||
|
||||
# cat /root/remember-db-user-pass.txt
|
||||
rm /root/remember-db-user-pass.txt
|
||||
if [ -f "/root/remember-db-user-pass.txt" ]; then
|
||||
rm /root/remember-db-user-pass.txt
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
|
|
|
@ -94,8 +94,11 @@ if [ -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
|
|||
echo "DB name: $db_name"
|
||||
echo "DB user: $db_user"
|
||||
echo "New DB password: $new_password"
|
||||
if [ $found_existing_password -eq 0 ] && [ -f "/root/remember-db-user-pass.txt" ]; then
|
||||
if [ $found_existing_password -eq 0 ]; then
|
||||
touch /root/remember-db-user-pass.txt
|
||||
echo "$db_user:$new_password" >> /root/remember-db-user-pass.txt
|
||||
chown root:root /root/remember-db-user-pass.txt
|
||||
chmod 600 /root/remember-db-user-pass.txt
|
||||
fi
|
||||
/usr/local/vesta/bin/v-change-database-password "$user" "$db_name" "$new_password"
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -126,4 +129,4 @@ fi
|
|||
# Logging
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
exit
|
||||
exit 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue