mirror of
https://gitlab.sectorq.eu/jaydee/mqtt_srv.git
synced 2025-12-14 18:44:53 +01:00
upt playbook
This commit is contained in:
@@ -1170,7 +1170,7 @@ else:
|
|||||||
check_router()
|
check_router()
|
||||||
elif host.lower() == "nas":
|
elif host.lower() == "nas":
|
||||||
print("Getting VM info")
|
print("Getting VM info")
|
||||||
|
payload = {"status":"on"}
|
||||||
cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh list --all"
|
cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh list --all"
|
||||||
writeLog(cmnd)
|
writeLog(cmnd)
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
@@ -1195,11 +1195,12 @@ else:
|
|||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
writeLog(output)
|
writeLog(output)
|
||||||
if output.strip() == "running":
|
if output.strip() == "running":
|
||||||
client.publish("sectorq/systems/nas/" + m, payload=1, qos=0, retain=True)
|
payload[m] = 1
|
||||||
else:
|
else:
|
||||||
client.publish("sectorq/systems/nas/" + m, payload=0, qos=0, retain=True)
|
payload[m] = 0
|
||||||
|
client.publish( "home-assistant/" + host + "/hwstats", payload=payload, qos=0, retain=True)
|
||||||
|
|
||||||
|
|
||||||
if FILE_TIMESTAMP != mtime:
|
if FILE_TIMESTAMP != mtime:
|
||||||
writeLog("Script updated ! restarting...")
|
writeLog("Script updated ! restarting...")
|
||||||
#os.execv(sys.executable, ['python'] + sys.argv)
|
#os.execv(sys.executable, ['python'] + sys.argv)
|
||||||
|
|||||||
Reference in New Issue
Block a user