test-ogclone/client/interfaceAdm/InventarioHardware.py

20 lines
634 B
Python

import subprocess
import sys
def list_hardware_info():
# Replace this with the actual command to list hardware info
result = subprocess.run(['listHardwareInfo'], capture_output=True, text=True)
return result.stdout
def save_hardware_inventory(output_file):
hardware_info = list_hardware_info()
lines = hardware_info.splitlines()
if len(lines) > 1:
with open(output_file, 'w') as f:
f.write('\n'.join(lines[1:]))
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python InventarioHardware.py <output_file>")
else:
save_hardware_inventory(sys.argv[1])