1 --- a/scripts/check_init_admin.py
2 +++ b/scripts/check_init_admin.py
3 @@ -310,7 +310,7 @@ def create_admin(email, passwd):
6 print('----------------------------------------')
7 - print('It\'s the first time you start the seafile server. Now let\'s create the admin account')
8 + print('Let\'s create the admin account')
9 print('----------------------------------------')
11 # whitespace is not allowed
12 @@ -350,8 +350,15 @@ def ask_admin_password():
18 + if len(argv) > 1 and argv[1] == 'has-admin':
19 + sys.exit(1 if need_create_admin() else 0)
21 if not need_create_admin():
23 + print('A seafile admin account already exists.')
24 + print('Log into seahub to add additional accounts.')
25 + print('If you cannot log in, run reset-seafile-admin to add a new admin account.')
28 password_file = os.path.join(os.environ['SEAFILE_CENTRAL_CONF_DIR'], 'admin.txt')
29 @@ -369,7 +376,7 @@ def main():
31 if __name__ == '__main__':
35 except KeyboardInterrupt:
37 print(Utils.highlight('Aborted.'))
38 @@ -379,3 +386,4 @@ if __name__ == '__main__':
40 print(Utils.highlight('Error happened during creating seafile admin.'))
43 --- a/scripts/seahub.sh
44 +++ b/scripts/seahub.sh
45 @@ -250,7 +250,10 @@ function stop_seahub () {
47 function check_init_admin() {
48 check_init_admin_script=${INSTALLPATH}/check_init_admin.py
49 - if ! $PYTHON $check_init_admin_script; then
50 + if ! $PYTHON $check_init_admin_script has-admin; then
51 + echo "Error: there is no seafile admin account."
52 + echo "Have you run create-seafile-admin before this?"