mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
build
This commit is contained in:
@@ -122,6 +122,7 @@ def check_router():
|
||||
serv_d[rul[0]] = {"src_port":rul[1],"dest_ip":rul[2],"dest_port":rul[3],"prot":rul[4]}
|
||||
stats["serv_dest"] = rul[2]
|
||||
break
|
||||
stats["status"] = "on"
|
||||
#stats["serv_dest"] = json.dumps(serv_d)
|
||||
#stats["serv_dest"] = json.dumps(serv_d)
|
||||
#out = subprocess.Popen(cmnd.split())
|
||||
@@ -170,6 +171,10 @@ else:
|
||||
if int(count) >= 2:
|
||||
writeLog("script exist")
|
||||
sys.exit()
|
||||
|
||||
|
||||
|
||||
|
||||
# Stops duplicate instance from running
|
||||
|
||||
writeLog(count)
|
||||
@@ -916,9 +921,9 @@ def on_message(client, userdata, msg):
|
||||
print("not a json!")
|
||||
|
||||
client = mqtt.Client()
|
||||
payload = "off"
|
||||
payload = '{"status":"off"}'
|
||||
client.username_pw_set("jaydee", password="jaydee1")
|
||||
client.will_set("sectorq/systems/" + host.lower() + "/stat", payload=payload, qos=0, retain=True)
|
||||
client.will_set("home-assistant/" + host.lower() + "/hwstats", payload=payload, qos=0, retain=True)
|
||||
client.on_connect = on_connect
|
||||
client.on_message = on_message
|
||||
writeLog(MQTT_HOST)
|
||||
|
||||
Reference in New Issue
Block a user