1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-04-28 11:15:58 +00:00
seahub/scripts/check-db-type.py
2021-12-04 10:45:31 +08:00

24 lines
540 B
Python

import sys
from configparser import ConfigParser
if len(sys.argv) != 2:
print('check-db-type.py <seafile-config-file>', file=sys.stderr)
seafile_conf_file = sys.argv[1]
parser = ConfigParser()
parser.read(seafile_conf_file)
if not parser.has_option('database', 'type'):
print('sqlite')
else:
db_type = parser.get('database', 'type')
if db_type == 'sqlite':
print('sqlite')
elif db_type == 'mysql':
print('mysql')
elif db_type == 'pgsql':
print('pgsql')
else:
print('unknown')