bitwarden

This commit is contained in:
jaydee
2024-11-29 01:40:48 +01:00
parent a704b0d132
commit 17c83dc0c5

View File

@@ -809,7 +809,7 @@ def on_message(client, userdata, msg):
subprocess.Popen(['/usr/bin/xrandr']) subprocess.Popen(['/usr/bin/xrandr'])
if myObj["cmd"] == "suspend": if myObj["cmd"] == "suspend":
print("suspending") writeLog("suspending")
if curos == "Windows": if curos == "Windows":
if host == "amd" or host == "amd1": if host == "amd" or host == "amd1":
os.system("shutdown /s /t 1") os.system("shutdown /s /t 1")
@@ -822,20 +822,24 @@ def on_message(client, userdata, msg):
#writeLog(output) #writeLog(output)
else: else:
if host == "nas" or host == "octopi": if host == "nas" or host == "octopi":
subprocess.Popen(["/sbin/poweroff"]) cmnd = "/sbin/poweroff"
elif host in ["openmediavault", "omv","amd","rack"]: elif host in ["openmediavault", "omv","amd","rack"]:
subprocess.Popen(["poweroff"]) cmnd = "poweroff"
elif host == "amd" or host == "ryzen": elif host == "amd" or host == "ryzen":
subprocess.Popen(["systemctl suspend"]) cmnd = "systemctl suspend"
else: else:
#subprocess.Popen(["/bin/systemctl", "suspend", "-i"]) #subprocess.Popen(["/bin/systemctl", "suspend", "-i"])
#subprocess.Popen(["sudo", "pm-suspend"]) #subprocess.Popen(["sudo", "pm-suspend"])
cmnd = "pm-suspend" cmnd = "pm-suspend"
status, output = subprocess.getstatusoutput(cmnd)
print(output)
print(status)
writeLog(cmnd) writeLog(cmnd)
#subprocess.Popen(cmnd)
status, output = subprocess.getstatusoutput(cmnd)
print(output)
print(status)
if myObj["cmd"] == "stats": if myObj["cmd"] == "stats":
grep = subprocess.Popen(['grep', 'cpu', '/proc/stat'], grep = subprocess.Popen(['grep', 'cpu', '/proc/stat'],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,