diff --git a/server-test.py b/server-test.py deleted file mode 100644 index 7f52482..0000000 --- a/server-test.py +++ /dev/null @@ -1,14 +0,0 @@ -import subprocess - -# Server IPMI details -IPMIHOST = "192.168.1.223" -IPMIUSER = "root" -IPMIPASS = "" - -def execute_ipmi_command(command): - full_command = f"ipmitool -I lanplus -H {IPMIHOST} -U {IPMIUSER} -P {IPMIPASS} {command}" - print(f"Executing command: {full_command}") # Print the full command to debug - result = subprocess.run(full_command, shell=True, capture_output=True, text=True) - print(result.stdout) - if result.stderr: - print(result.stderr) diff --git a/server.py b/server.py index 671b7a8..0f3aaeb 100644 --- a/server.py +++ b/server.py @@ -8,7 +8,11 @@ IPMIPASS = "" def execute_ipmi_command(command): full_command = f"ipmitool -I lanplus -H {IPMIHOST} -U {IPMIUSER} -P {IPMIPASS} {command}" - subprocess.run(full_command, shell=True) + print(f"Executing command: {full_command}") # Print the full command to debug + result = subprocess.run(full_command, shell=True, capture_output=True, text=True) + print(result.stdout) + if result.stderr: + print(result.stderr) def power_on(): print("Powering on the server...")