diff --git a/scripts/create_user.py b/scripts/create_user.py index 081190c7..2b03f18e 100755 --- a/scripts/create_user.py +++ b/scripts/create_user.py @@ -13,6 +13,7 @@ def _create_parser(): parser.add_argument('--password', help='Password to use', required=True) parser.add_argument('--keys', help='Account keys to add to the new account', action='append', default=['NORMAL','PAYING']) parser.add_argument('--email', help='Email address to use', default='test@test.bbs') + parser.add_argument('--dbfile', help='Database specified by appsettings.json Database.File', default='mbbsemu.db') return parser.parse_args() @@ -25,7 +26,7 @@ def _make_password_hash(password, salt_bytes): def _main(): args = _create_parser() - conn = sqlite3.connect('mbbs.db') + conn = sqlite3.connect(args.dbfile) passwordSaltBytes=os.urandom(32) passwordHashBytes=_make_password_hash(args.password, passwordSaltBytes) @@ -42,5 +43,7 @@ def _main(): cur.execute('INSERT INTO AccountKeys (accountId, accountKey, createDate, updateDate) VALUES (?,?,datetime(\'now\'), datetime(\'now\'))', t) conn.commit() + print("Database updated; now you need to go run MBBSEmu -CLI -DBREBUILD BBSUSR to rebuild the runtime user database.") + if __name__ == '__main__': _main()