diff --git a/print.py b/print.py index 1faf65a..fd142ef 100644 --- a/print.py +++ b/print.py @@ -2,6 +2,7 @@ import socket import json +import os from flask import Flask, render_template CheckPrinterOnline = '7e4d3630312053310d0a' @@ -9,7 +10,10 @@ MachingInfo = "7e4d3131350d0a" GetPrintPercent = "7e4d32370d0a" GetPrinterTemp = "7e4d3130350d0a" -HOST = '10.1.1.83' # The server's hostname or IP address +if os.environ.get('IPADDR') == None: + print("IPADDR environment variable not set please set to printer IP") + SystemExit() +HOST = os.environ.get('IPADDR') # The server's hostname or IP address PORT = 8899 # The port used by the server application = Flask(__name__)