Update index.py

pull/321/head
midoks 2 years ago
parent df2a5919af
commit 16b4c64aa5
  1. 16
      plugins/mysql/index.py

@ -127,7 +127,21 @@ def contentReplace(content):
def pSqliteDb(dbname='databases'):
file = getServerDir() + '/mysql.db'
name = 'mysql'
if not os.path.exists(file):
import_sql = mw.readFile(getPluginDir() + '/conf/mysql.sql')
md5_sql = mw.md5(import_sql)
import_sign = False
save_md5_file = getServerDir() + '/import_sql.md5'
if os.path.exists(save_md5_file):
save_md5_sql = mw.readFile(save_md5_file)
if save_md5_sql == md5_sql:
import_sign = True
else:
mw.writeFile(save_md5_file, md5_sql)
if not os.path.exists(file) or import_sql:
conn = mw.M(dbname).dbPos(getServerDir(), name)
csql = mw.readFile(getPluginDir() + '/conf/mysql.sql')
csql_list = csql.split(';')

Loading…
Cancel
Save