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!
@@ -233,6 +234,17 @@ remove_db_users()
233234 verbose " DOMjudge database and user(s) removed."
234235}
235236
237+ update_password ()
238+ {
239+ read_dbpasswords
240+ (
241+ echo " ALTER USER '$domjudge_DBUSER '@'localhost' IDENTIFIED BY '$domjudge_PASSWD ';"
242+ echo " FLUSH PRIVILEGES;"
243+ ) | mysql
244+ verbose " ALTER USER '$domjudge_DBUSER '@'localhost' IDENTIFIED BY '$domjudge_PASSWD ';"
245+ verbose " Database user password updated from credentials file."
246+ }
247+
236248install_examples ()
237249{
238250 DBUSER=$domjudge_DBUSER PASSWD=$domjudge_PASSWD symfony_console domjudge:load-example-data
@@ -320,6 +332,10 @@ create-db-users)
320332 create_db_users
321333 ;;
322334
335+ update-password)
336+ update_password
337+ ;;
338+
323339bare-install|install)
324340 read_dbpasswords
325341 create_db_users
You can’t perform that action at this time.
0 commit comments