add ip update

This commit is contained in:
vvzvlad 2025-04-20 18:52:55 +03:00
parent e7f4bb6a35
commit a9ee8e1f80

View File

@ -326,6 +326,15 @@ if __name__ == "__main__":
for attempt in range(3): for attempt in range(3):
try: try:
vm_ip = os.popen("ip -4 addr show eth0 | grep -oP '(?<=inet )[^/]+'").read()
vm_ip = vm_ip.strip()
if vm_ip == "":
logger.error("Failed to get VM IP address")
else:
logger.info(f"VM IP address: {vm_ip}")
grist_callback({"IP": f"{vm_ip}"})
# Pass initial state to check_logs # Pass initial state to check_logs
result = check_logs(logger, initial_sync_count, previous_status_type) result = check_logs(logger, initial_sync_count, previous_status_type)