31 lines
831 B
Python
31 lines
831 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Test script to verify restart logic
|
|
"""
|
|
import sys
|
|
import os
|
|
import subprocess
|
|
|
|
def test_restart_logic():
|
|
print("Testing restart logic...")
|
|
|
|
# Simulate the restart logic
|
|
script_path = os.path.abspath(__file__)
|
|
print(f"Current script path: {script_path}")
|
|
print(f"sys.argv: {sys.argv}")
|
|
print(f"__name__: {__name__}")
|
|
print(f"sys.executable: {sys.executable}")
|
|
print(f"Current working directory: {os.getcwd()}")
|
|
|
|
# Show what command would be used for restart
|
|
if __name__ != "__main__":
|
|
args = [sys.executable] + sys.argv
|
|
else:
|
|
args = [sys.executable, script_path]
|
|
|
|
print(f"Restart command would be: {' '.join(args)}")
|
|
print("Test completed - no actual restart performed")
|
|
|
|
if __name__ == "__main__":
|
|
test_restart_logic()
|