LitterBox v4.0.0
This commit is contained in:
+7
-2
@@ -14,6 +14,7 @@ def is_running_as_admin():
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--debug', action='store_true', help='Enable debug mode')
|
||||
parser.add_argument('--ip', type=str, help='Specify host IP address (e.g., --ip 192.168.1.120)')
|
||||
args = parser.parse_args()
|
||||
|
||||
if not is_running_as_admin():
|
||||
@@ -22,6 +23,11 @@ def main():
|
||||
|
||||
app = create_app()
|
||||
|
||||
# Set host IP if provided
|
||||
if args.ip:
|
||||
app.config['application']['host'] = args.ip
|
||||
print(f"[+] Host IP set to: {args.ip}")
|
||||
|
||||
# Enable debug mode based on the `--debug` flag
|
||||
if args.debug:
|
||||
app.config['DEBUG'] = True
|
||||
@@ -29,6 +35,7 @@ def main():
|
||||
|
||||
# Set up logging based on the debug mode
|
||||
setup_logging(app)
|
||||
|
||||
# Run the app
|
||||
app.run(
|
||||
host=app.config['application']['host'],
|
||||
@@ -36,7 +43,5 @@ def main():
|
||||
debug=app.config['DEBUG'] # Flask debug mode
|
||||
)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user