Skip to content

Commit c77efcc

Browse files
authored
Merge pull request #473 from midoks/dev
mysql初始安装优化
2 parents 3c388ad + 962b0fa commit c77efcc

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ data/unauthorized_status.pl
158158
plugins/vip_*
159159
plugins/own_*
160160
plugins/my_*
161+
plugins/op_auth
161162
plugins/l2tp
162163
plugins/openlitespeed
163164
plugins/tamper_proof

plugins/mariadb/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ def initMariaDbPwd():
402402
pwd + ' -e "drop database test";'
403403
mw.execShell(drop_test_db)
404404

405+
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
406+
405407
# 删除冗余账户
406408
hostname = mw.execShell('hostname')[0].strip()
407409
if hostname != 'localhost':
@@ -412,8 +414,6 @@ def initMariaDbPwd():
412414
drop_root_hostname = serverdir + '/bin/mysql --defaults-file=' + \
413415
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
414416
mw.execShell(drop_root_hostname)
415-
416-
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
417417
return True
418418

419419

plugins/mysql-apt/index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ def initMysql8Pwd():
405405
pwd + ' -e "drop database test";'
406406
mw.execShell(drop_test_db)
407407

408+
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
409+
408410
# 删除冗余账户
409411
hostname = mw.execShell('hostname')[0].strip()
410412
if hostname != 'localhost':
@@ -416,7 +418,6 @@ def initMysql8Pwd():
416418
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
417419
mw.execShell(drop_root_hostname)
418420

419-
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
420421
return True
421422

422423

plugins/mysql-yum/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ def initMysql8Pwd():
394394
pwd + ' -e "drop database test";'
395395
mw.execShell(drop_test_db)
396396

397+
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
398+
397399
# 删除冗余账户
398400
hostname = mw.execShell('hostname')[0].strip()
399401
if hostname != 'localhost':
@@ -404,8 +406,6 @@ def initMysql8Pwd():
404406
drop_root_hostname = cmd_my + ' --defaults-file=' + \
405407
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
406408
mw.execShell(drop_root_hostname)
407-
408-
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
409409
return True
410410

411411

plugins/mysql/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ def initMysql8Pwd():
509509
myconf + ' -uroot -p' + pwd + ' -e "drop database test";'
510510
mw.execShell(drop_test_db)
511511

512+
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
513+
512514
# 删除冗余账户
513515
hostname = mw.execShell('hostname')[0].strip()
514516
if hostname != 'localhost':
@@ -520,8 +522,6 @@ def initMysql8Pwd():
520522
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
521523
mw.execShell(drop_root_hostname)
522524

523-
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
524-
525525
return True
526526

527527

plugins/openresty/index.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ def getOs():
8686
data = {}
8787
data['os'] = mw.getOs()
8888
ng_exe_bin = getServerDir() + "/nginx/sbin/nginx"
89+
90+
if mw.isAppleSystem():
91+
data['auth'] = True
92+
return mw.getJson(data)
93+
8994
if checkAuthEq(ng_exe_bin, 'root'):
9095
data['auth'] = True
9196
else:

0 commit comments

Comments
 (0)