mirror of
https://github.com/AndrewX192/lenovo-sa120-fanspeed-utility
synced 2026-01-06 08:23:14 +00:00
Merge pull request #5 from kroy-the-rabbit/master
Allows script to set fan speed on multiple enclosures
This commit is contained in:
@@ -33,14 +33,6 @@ for chk_device in devices_to_check:
|
|||||||
out = check_output(["sg_ses", dev_node], stderr=STDOUT)
|
out = check_output(["sg_ses", dev_node], stderr=STDOUT)
|
||||||
if 'ThinkServerSA120' in out:
|
if 'ThinkServerSA120' in out:
|
||||||
device = dev_node
|
device = dev_node
|
||||||
break
|
|
||||||
except:
|
|
||||||
print("Enclosure not found on " + dev_node)
|
|
||||||
|
|
||||||
if device == "":
|
|
||||||
print("Could not find enclosure")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
print("Enclosure found on " + device);
|
print("Enclosure found on " + device);
|
||||||
|
|
||||||
print_speeds(device)
|
print_speeds(device)
|
||||||
@@ -81,3 +73,9 @@ print("Set fan speeds... Waiting to get fan speeds (ctrl+c to skip)")
|
|||||||
print(p.communicate(input=bytearray(output.getvalue(), 'utf-8'))[0].decode('utf-8'))
|
print(p.communicate(input=bytearray(output.getvalue(), 'utf-8'))[0].decode('utf-8'))
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
print_speeds(device)
|
print_speeds(device)
|
||||||
|
except:
|
||||||
|
print("Enclosure not found on " + dev_node)
|
||||||
|
|
||||||
|
if device == "":
|
||||||
|
print("Could not find enclosure")
|
||||||
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user