Fix startup and create db path

Fix for listen args and create db path if it doesn't exist
This commit is contained in:
Brian Martin 2019-05-12 15:20:10 -04:00
parent 17d7ee5f66
commit 2683421c34
2 changed files with 12 additions and 9 deletions

View file

@ -10,6 +10,7 @@ import asyncio
def main():
args = sys.argv
listen_host = ""
if len(args) > 0:
if "--debug" in args:
@ -24,16 +25,14 @@ def main():
)
# format="[%(asctime)s] :: %(levelname)s :: %(name)s :: %(module)s :: %(funcName)s :: %(lineno)d :: %(message)s")
listen_host = args.index("--listen")
if (len(args) - 1) >= (listen_host + 1):
listen_host = args[listen_host+1]
else:
if "--listen" in args:
listen_host = args[args.index("--listen") + 1]
if listen_host == "":
if platform.system() == "Darwin": # If a Mac, use 0.0.0.0 for listening
listen_host = "0.0.0.0"
else:
listen_host = socket.gethostbyname(socket.gethostname())
#listen_host = "localhost" # Try this if the above doesn't work
listen_host = socket.gethostbyname(socket.gethostname())
conf_address_443 = (listen_host, 443)
conf_address_8007 = (listen_host, 8007)