浏览代码

Reset admin password after the db settings are stored

Girish Ramakrishnan 10 年之前
父节点
当前提交
151c2ffa67
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      start.sh

+ 3 - 2
start.sh

@@ -54,8 +54,6 @@ EOF
 else
     rm -rf /app/code/wp-content # upgrades & updates - starting out with existing data
     ln -sf /app/data/wp-content /app/code/wp-content
-
-    $WP user update $($WP user get admin --field=ID) --user_pass="${admin_password}"
 fi
 
 # Settings to be updated on every run
@@ -65,6 +63,9 @@ sed -e "s/define('DB_NAME',.*/define('DB_NAME', '${MYSQL_DATABASE}');/" \
     -e "s/define('DB_HOST',.*/define('DB_HOST', '${MYSQL_HOST}');/" \
     -i /app/data/wp-config.php # sed -i seems to destroy symlink
 
+# reset the admin password
+$WP user update $($WP user get admin --field=ID) --user_pass="${admin_password}"
+
 # configure WP mail smtp plugin (smtp_user, smtp_pass can be set when supported)
 $WP option update mailer smtp
 $WP option update mail_from ${MAIL_SMTP_USERNAME}@${MAIL_DOMAIN}