File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ Commands:
2929 status check database installation status
3030 genpass generate DB,API,Symfony,admin password files
3131 create-db-users create (empty) database and users
32+ update-password update DB user database to that in 'etc/dbpasswords.secret'
3233 install create database, example contest and users if not existing
3334 bare-install create database, setup defaults if not existing
3435 uninstall remove database users and database, INCLUDING ALL DATA!
@@ -235,6 +236,17 @@ remove_db_users()
235236 verbose " DOMjudge database and user(s) removed."
236237}
237238
239+ update_password ()
240+ {
241+ read_dbpasswords
242+ (
243+ echo " ALTER USER '$domjudge_DBUSER '@'localhost' IDENTIFIED BY '$domjudge_PASSWD ';"
244+ echo " FLUSH PRIVILEGES;"
245+ ) | mysql
246+ verbose " ALTER USER '$domjudge_DBUSER '@'localhost' IDENTIFIED BY '$domjudge_PASSWD ';"
247+ verbose " Database user password updated from credentials file."
248+ }
249+
238250install_examples ()
239251{
240252 DBUSER=$domjudge_DBUSER PASSWD=$domjudge_PASSWD symfony_console domjudge:load-example-data
@@ -337,6 +349,10 @@ create-db-users)
337349 create_db_users_helper
338350 ;;
339351
352+ update-password)
353+ update_password
354+ ;;
355+
340356bare-install|install)
341357 read_dbpasswords
342358 create_db_users
You can’t perform that action at this time.
0 commit comments