Backup config file

This commit is contained in:
JonnyWong16 2016-05-12 22:00:34 -07:00
parent b0eb98c667
commit 6aa786698e
9 changed files with 127 additions and 64 deletions

View file

@ -33,7 +33,7 @@ import signal
import time
import plexpy
from plexpy import logger, web_socket, webstart
from plexpy import config, database, logger, web_socket, webstart
# Register signals, such as CTRL + C
@ -148,7 +148,7 @@ def main():
if args.config:
config_file = args.config
else:
config_file = os.path.join(plexpy.DATA_DIR, 'config.ini')
config_file = os.path.join(plexpy.DATA_DIR, config.FILENAME)
# Try to create the DATA_DIR if it doesn't exist
if not os.path.exists(plexpy.DATA_DIR):
@ -164,7 +164,7 @@ def main():
'Cannot write to the data directory: ' + plexpy.DATA_DIR + '. Exiting...')
# Put the database in the DATA_DIR
plexpy.DB_FILE = os.path.join(plexpy.DATA_DIR, 'plexpy.db')
plexpy.DB_FILE = os.path.join(plexpy.DATA_DIR, database.FILENAME)
if plexpy.DAEMON:
plexpy.daemonize()