diff --git a/restart.py b/restart.py new file mode 100644 index 0000000..65b8a74 --- /dev/null +++ b/restart.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +import os +import sys +import time + +# Change directory to the project root +os.chdir(os.path.dirname(os.path.abspath(__file__))) + +try: + import manage_webui +except ImportError: + print("Error: manage_webui.py not found in the project root.", file=sys.stderr) + sys.exit(1) + +if __name__ == '__main__': + manage_webui.stop() + time.sleep(1) + + # Setup check and auto-install baked in + if not os.path.exists(manage_webui.VENV_DIR): + print("Virtual environment not found. Initializing setup...") + manage_webui.setup() + print("") + + manage_webui.start() diff --git a/start.py b/start.py new file mode 100644 index 0000000..804d170 --- /dev/null +++ b/start.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +import os +import sys + +# Change directory to the project root +os.chdir(os.path.dirname(os.path.abspath(__file__))) + +try: + import manage_webui +except ImportError: + print("Error: manage_webui.py not found in the project root.", file=sys.stderr) + sys.exit(1) + +if __name__ == '__main__': + # Setup check and auto-install baked in + if not os.path.exists(manage_webui.VENV_DIR): + print("Virtual environment not found. Initializing setup...") + manage_webui.setup() + print("") + + manage_webui.start() diff --git a/stop.py b/stop.py new file mode 100644 index 0000000..a63dfee --- /dev/null +++ b/stop.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import os +import sys + +# Change directory to the project root +os.chdir(os.path.dirname(os.path.abspath(__file__))) + +try: + import manage_webui +except ImportError: + print("Error: manage_webui.py not found in the project root.", file=sys.stderr) + sys.exit(1) + +if __name__ == '__main__': + manage_webui.stop()