LitterBox v4.0.0
This commit is contained in:
+11
-6
@@ -14,21 +14,28 @@ def is_running_as_admin():
|
|||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--debug', action='store_true', help='Enable debug mode')
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if not is_running_as_admin():
|
if not is_running_as_admin():
|
||||||
print("[!] This script requires administrative privileges. Please run as administrator.")
|
print("[!] This script requires administrative privileges. Please run as administrator.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
app = create_app()
|
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
|
# Enable debug mode based on the `--debug` flag
|
||||||
if args.debug:
|
if args.debug:
|
||||||
app.config['DEBUG'] = True
|
app.config['DEBUG'] = True
|
||||||
app.config['application']['debug'] = True # Optional if your custom config also uses it
|
app.config['application']['debug'] = True # Optional if your custom config also uses it
|
||||||
|
|
||||||
# Set up logging based on the debug mode
|
# Set up logging based on the debug mode
|
||||||
setup_logging(app)
|
setup_logging(app)
|
||||||
|
|
||||||
# Run the app
|
# Run the app
|
||||||
app.run(
|
app.run(
|
||||||
host=app.config['application']['host'],
|
host=app.config['application']['host'],
|
||||||
@@ -36,7 +43,5 @@ def main():
|
|||||||
debug=app.config['DEBUG'] # Flask debug mode
|
debug=app.config['DEBUG'] # Flask debug mode
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user