mirror of
https://gitlab.sectorq.eu/jaydee/mqtt_srv.git
synced 2025-12-14 10:34:53 +01:00
bitwarden
This commit is contained in:
18
mqtt_srv.py
18
mqtt_srv.py
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user